mirror of
https://github.com/lukaszraczylo/beat-delivery-methodology.git
synced 2026-11-25 11:06:00 +00:00
Merge pull request #17 from lukaszraczylo/locust/f23dd8ce
BEAT methodology: weak-point review and website redesign
This commit is contained in:
@@ -22,7 +22,7 @@ Through this work we have come to value:
|
||||
|
||||
**Sustainable pace** over heroic effort
|
||||
|
||||
**Small experiments** over perfect plans
|
||||
**Small experiments** over careful plans
|
||||
|
||||
---
|
||||
|
||||
@@ -48,83 +48,95 @@ Beyond what we value in our work, we hold these values in how we treat each othe
|
||||
|
||||
## The Twelve Principles of BEAT
|
||||
|
||||
<!-- id: principle-focus -->
|
||||
|
||||
### On Focus
|
||||
|
||||
**1. Protect the focus state above all else.**
|
||||
|
||||
The uninterrupted mind produces the best work. We maintain sacred blocks of four hours daily where no meetings, messages, or interruptions are permitted. The maker chooses when this time occurs.
|
||||
Sacred blocks come first, because everything else in the plan depends on them. A maker protects a focus block of four hours each working day — a BEAT default, listed in the constraints table — and chooses when it falls. The only exception is a declared production incident: the incident lead may suspend a block, and only for the time the incident runs.
|
||||
|
||||
**2. Interruptions are not free.**
|
||||
|
||||
Research shows 52 minutes to reach deep focus, 23 minutes to recover from interruption. Every "quick question" costs more than it appears. Default to async. Wait for the open window.
|
||||
Interrupting someone costs more than the question appears to. Resuming interrupted work takes about twenty-five minutes [mark-2005], and the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014]. So we default to async and wait for the open window.
|
||||
|
||||
**3. Presence does not equal productivity.**
|
||||
|
||||
We do not measure hours worked or time online. We measure outcomes delivered. A maker in focus for four hours outproduces a maker in meetings for eight.
|
||||
We do not measure hours worked or time online. We measure outcomes delivered. Presence is not evidence of output, so a maker is judged by what ships, not by hours spent in meetings.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: principle-communication -->
|
||||
|
||||
### On Communication
|
||||
|
||||
**4. Writing is thinking made visible.**
|
||||
|
||||
We write by default. Decisions not documented did not happen. Written words can be searched, referenced, and shared across time zones. They outlive the meeting that never was.
|
||||
We write by default. A decision counts only when it is written down and the record names who decided it — silence is not consent. Written words can be searched, referenced, and shared across time zones. They outlive the meeting that never was.
|
||||
|
||||
**5. Synchronous time is expensive. Spend it wisely.**
|
||||
|
||||
Meetings cost everyone present, simultaneously. We limit them to two hours per week, one hour maximum each. If it can be written, write it. If it must be discussed, write first, then discuss the delta.
|
||||
Meetings cost everyone present, simultaneously, and the people who need the room most are rarely in it. Surveyed knowledge workers reported lower productivity above two hours a day in meetings [slack-workplace-lab-2017]. We limit meetings to the budget in the constraints table, one hour maximum each, and a declared incident is the only exception. If it can be written, write it; if it must be discussed, write first, then discuss the delta.
|
||||
|
||||
**6. Response time is not reaction time.**
|
||||
|
||||
Async means responding when working, not responding immediately. We expect responses within 24 working hours. Urgent means phone call. Everything else waits.
|
||||
Async means responding when working, not responding immediately. We expect a response within 24 working hours — the BEAT default, listed in the constraints table — counted against the coverage hours in the time-zone rules. Urgent means a phone call to the on-call rota, and the rota names the fallback when nobody answers. Everything else waits.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: principle-autonomy -->
|
||||
|
||||
### On Autonomy
|
||||
|
||||
**7. Trust makers to make.**
|
||||
|
||||
Those who build the thing decide how to build it. They choose their tools, their approach, their schedule, their collaborators. We provide goals and constraints, not instructions.
|
||||
Those who build the thing decide how to build it. They choose their tools, their approach, their schedule, their collaborators. Method is the maker's. The done condition is the team's, and a maker who cannot meet one raises it before the work starts, not after. We give makers autonomy because autonomy, competence and relatedness are the needs that make sustained motivation possible [deci-ryan-2000] — a general motivation finding, not a result about developers. We provide goals and constraints, not instructions.
|
||||
|
||||
**8. Pull, don't push.**
|
||||
|
||||
Work is not assigned. Work is pulled by those with capacity and interest. Makers select from a prioritized stack. They may skip with reason. They may propose alternatives.
|
||||
Work is not assigned. Work is pulled by those with capacity and interest. The Enabler orders the stack — priority and order, never assignment — and makers pull from the top of it. A maker may skip an item with a reason, propose an alternative, and object to the order through the dispute path in the priority rules.
|
||||
|
||||
**9. The maker's "no" is valid.**
|
||||
|
||||
Makers may refuse work that is unethical, impossible, or poorly conceived. They may challenge priorities. They may push back on requirements. This is not insubordination—it is ownership.
|
||||
Makers may refuse work that is unethical, impossible, or poorly conceived. They may challenge priorities. They may push back on requirements. A refusal is a decision and is recorded like any other: this is not insubordination—it is ownership.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: principle-sustainability -->
|
||||
|
||||
### On Sustainability
|
||||
|
||||
**10. Sustainable pace is not optional.**
|
||||
|
||||
Overtime is a red flag, not a badge of honor. When deadlines conflict with capacity, we cut scope. We never cut rest. Burnout destroys teams. Recovery is productive. We plan at 80% and leave slack for life.
|
||||
Overtime is a red flag, not a badge of honor. When deadlines conflict with capacity, we cut scope and we never cut rest. The capacity plan belongs to the Enabler, is set per maker for each beat at eighty percent of that maker's available working time, and says what does not fit. When a NOW item would break the plan, the deadline moves before the rest does.
|
||||
|
||||
**11. The team's health is the Enabler's responsibility.**
|
||||
|
||||
Someone must watch for warning signs: maxed WIP, skipped check-ins, overtime patterns, withdrawal. Someone must shield the team from organizational noise. Someone must say "no" to protect "yes."
|
||||
Someone must watch for warning signs: maxed WIP, skipped check-ins, overtime patterns, withdrawal. Someone must shield the team from organizational noise. Someone must say "no" to protect "yes." That someone is the Enabler, and the thresholds behind each warning sign are listed with the measurement rules.
|
||||
|
||||
**12. Exploration time is not a reward. It is a requirement.**
|
||||
|
||||
Twenty percent of time belongs to the maker for learning, tooling, experiments, and interests. No justification required. No approval needed. This is how we stay sharp. This is how we find better ways.
|
||||
A fifth of each maker's working time belongs to learning, tooling, experiments, and interests — a BEAT default, listed in the constraints table. No justification required. No approval needed. Exploration does not consume a work-in-progress slot and does not sit on the board: it is scheduled, not tracked as work.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: section-method -->
|
||||
|
||||
## The Framework
|
||||
|
||||
The principles above guide us. The framework below implements them.
|
||||
|
||||
Every rule in this section states what it applies to, who decides it, and what to do when it does not fit.
|
||||
|
||||
---
|
||||
|
||||
### Roles
|
||||
|
||||
We recognize three roles, loosely held:
|
||||
|
||||
**The Maker** builds things. They have full autonomy over implementation. They pull work, propose solutions, review code, and surface blockers. They choose what, how, when, where, and with whom.
|
||||
**The Maker** builds things. They have full autonomy over implementation. They pull work, propose solutions, review code, and surface blockers. They choose what, how, when, where, and with whom. The done condition is the team's, not theirs to change alone.
|
||||
|
||||
**The Enabler** removes obstacles. They maintain the priority stack, shield from interruptions, monitor wellbeing, and facilitate decisions. They do not dictate—they enable.
|
||||
**The Enabler** removes obstacles. They order the priority stack, shield from interruptions, monitor wellbeing, and facilitate decisions. They do not dictate—they enable: they set order and capacity, never assignment. They plan capacity at the level in the measurement rules. When they are a party to a dispute, they step out of it.
|
||||
|
||||
**The Connector** maintains knowledge flow. They keep documentation current, ensure context flows between makers, and onboard new members. This role is optional and may rotate.
|
||||
|
||||
@@ -138,6 +150,8 @@ Beats have **goals**, not commitments. We aim; we do not promise. Beats flow int
|
||||
|
||||
At beat start, we review priorities and pull initial work. During the beat, we check in async daily. At beat close, we reflect: what worked, what didn't, what to improve.
|
||||
|
||||
A commitment made outside the team is renegotiated by whoever made it, with the Enabler helping, and the team hears about it before the next beat starts.
|
||||
|
||||
---
|
||||
|
||||
### Work Items
|
||||
@@ -152,6 +166,8 @@ Documentation effort scales with task size:
|
||||
|
||||
We size with **S/M/L**, not story points. We do not groom. We do not point. We do not track velocity.
|
||||
|
||||
Sizing applies to team-internal planning. A team that must report to an external programme, a regulator or a regulated customer keeps that reporting obligation and adapts the method around it.
|
||||
|
||||
---
|
||||
|
||||
### Definition of Done
|
||||
@@ -160,19 +176,21 @@ Work is not done until it meets these criteria:
|
||||
|
||||
**For Code:**
|
||||
- Code works as intended
|
||||
- Tests pass (existing and new where appropriate)
|
||||
- Code reviewed by at least one other maker
|
||||
- Tests pass: the existing suite passes, and new behaviour carries a test unless the team has agreed an exception for it, which the Enabler records
|
||||
- Code reviewed by at least one other maker, or auto-proceeded under the review rule with the exceptions in that rule named in the merge
|
||||
- Merged to main branch
|
||||
- Deployable (or deployed, depending on team practice)
|
||||
- No known defects introduced
|
||||
- Deployable: the artefact builds and runs for the team's own use, and is deployed where the team deploys its own work
|
||||
- No known defects introduced: a defect found during the work and logged as its own item does not block this one, provided it is recorded before the merge
|
||||
|
||||
**For Non-Code:**
|
||||
- Meets the stated "done when" condition
|
||||
- Reviewed by relevant party if needed
|
||||
- Reviewed by the relevant party where the item names one; where it names none, the maker decides
|
||||
- Documented where others can find it
|
||||
|
||||
**The team owns this definition.** Adjust it as needed. But once agreed, honor it. "Done" means done—not "done but..." or "done except..."
|
||||
|
||||
If a maker cannot meet a condition, they raise it before the work starts; the team either changes the condition or the work does not start.
|
||||
|
||||
If something is merged but not truly done, it carries hidden cost. Be honest about completeness.
|
||||
|
||||
---
|
||||
@@ -181,15 +199,15 @@ If something is merged but not truly done, it carries hidden cost. Be honest abo
|
||||
|
||||
We use four buckets:
|
||||
|
||||
**NOW** — Critical, blocking, time-sensitive. Maximum five items.
|
||||
**NOW** — Critical, blocking, time-sensitive. Maximum five items — a BEAT default, listed in the constraints table. When the bucket needs more than the capacity plan allows, the plan wins: the deadline moves or the scope shrinks.
|
||||
|
||||
**NEXT** — High value for this beat. An ordered stack. Pull from top.
|
||||
**NEXT** — High value for this beat. An ordered stack. Pull from top. The order is the Enabler's to set; any maker may dispute it through the priority rules.
|
||||
|
||||
**LATER** — Valuable but not urgent. The backlog.
|
||||
|
||||
**ICEBOX** — Someday, or needs more thought. Revisit quarterly.
|
||||
|
||||
The Enabler sets the stack. Makers may adjust with reason. Disputes resolve async, then sync if stuck.
|
||||
The Enabler orders the stack, on priority and capacity; they do not assign items to makers. Makers may adjust the order with a reason. A maker who objects to the order says so asynchronously, with their reason. If nobody answers within 24 working hours — a BEAT default, not a research finding — the dispute goes to a short synchronous discussion, and the Enabler decides unless they are a party to it, in which case the team decides.
|
||||
|
||||
---
|
||||
|
||||
@@ -201,18 +219,22 @@ A simple kanban with priority built in:
|
||||
ICE → LATER → NEXT → IN PROGRESS → DONE
|
||||
```
|
||||
|
||||
Work-in-progress limit: three per maker. NEXT is ordered. NOW pins to top. Items stale for five days return to backlog.
|
||||
Work-in-progress limit: three per maker. The maker stops taking new work at the limit. If the maker is blocked and every remaining item is blocked too, they say so in the check-in and the Enabler unblocks or reorders.
|
||||
|
||||
NEXT is ordered. NOW pins to top. Items with no activity for five working days return to the backlog, unless the maker pins them as intentionally parked; the pin is reviewed at the next beat close, and an unpinned item returns to the backlog. The Enabler sweeps the board at each beat close.
|
||||
|
||||
---
|
||||
|
||||
### Meetings
|
||||
|
||||
Hard limits:
|
||||
Hard limits — all of them BEAT defaults, listed in the constraints table:
|
||||
|
||||
- **Two hours per week** total
|
||||
- **Two hours per week** total, for recurring and scheduled meetings inside a working week
|
||||
- **One hour maximum** per meeting
|
||||
- **Agenda required** or meeting cancelled
|
||||
|
||||
The Enabler schedules; a meeting without an agenda is cancelled. Ad-hoc help and a blocked work item count against the same budget. A declared incident is the only exception: the incident lead runs it outside the budget.
|
||||
|
||||
We hold:
|
||||
|
||||
- **Beat Start** (30 min): Goals, priorities
|
||||
@@ -233,7 +255,7 @@ Working on: [current task]
|
||||
Blocked by: [nothing / specific issue]
|
||||
```
|
||||
|
||||
Post once daily, when convenient. Two minutes. No gathering required.
|
||||
Post once daily, when convenient, in your own working day. Two minutes. No gathering required.
|
||||
|
||||
---
|
||||
|
||||
@@ -243,7 +265,7 @@ Default mode is **solo deep work**.
|
||||
|
||||
Help is **ad-hoc**: post when stuck, someone responds when available, sync briefly if needed, return to solo work.
|
||||
|
||||
We do not schedule pairing. We do not mandate walkthroughs. We do not assign buddies. Collaboration is initiated by those who need it.
|
||||
We do not schedule pairing. We do not mandate walkthroughs. Collaboration is initiated by those who need it. Where a team adds a mentor for a new member, that is the onboarding ramp, not a standing pairing: the mentor's time is planned capacity like any other work.
|
||||
|
||||
---
|
||||
|
||||
@@ -263,13 +285,13 @@ Large features require coordination without ceremony:
|
||||
|
||||
### Avoiding Chokepoints
|
||||
|
||||
**Reviews:** Anyone can review. Four-hour response SLA. Auto-proceed after 24 hours if CI passes.
|
||||
**Reviews:** Anyone can review, so nobody is the assigned reviewer. Four working-hour response window, counted inside the coverage hours of the reference time zone. Auto-proceed after 24 working hours if the build passes: the author merges, or asks the Enabler to merge, once the window closes. A change with security, data-migration or billing impact, and a change to a dependency other teams consume, waits for a named reviewer and never auto-proceeds. Open review comments also stop auto-proceed: the author answers them or asks for a named reviewer.
|
||||
|
||||
**Merges:** Merge main daily. Claim files. Keep branches short-lived.
|
||||
**Merges:** Merge main daily. Claim files in the branch protection rule before you start; when two makers claim the same file, the earlier claim stands and the later one re-plans around it. Keep branches short-lived. A day is a working day in the reference time zone.
|
||||
|
||||
**Blockers:** Surface in check-in. Pull different work while waiting. Enabler escalates.
|
||||
**Blockers:** Surface in check-in. Pull different work while waiting. The Enabler escalates a blocker inside the team by reordering the board; a blocker that belongs to another team is escalated through the dependency rules.
|
||||
|
||||
**Decisions:** Post recommendation. Wait 24 hours. No objection means proceed. Dispute means brief sync, then owner decides.
|
||||
**Decisions:** Post a recommendation naming the owner. Wait 24 working hours — a BEAT default, not a research finding. No objection means the decision is recorded and stands; silence is not consent on its own, so the record says who decided. An objection moves it to a brief synchronous discussion, and the owner decides.
|
||||
|
||||
---
|
||||
|
||||
@@ -285,35 +307,67 @@ When you find something wrong while doing something else:
|
||||
|
||||
**Production critical?** Flag team immediately.
|
||||
|
||||
The five-minute line is a BEAT default, not a measured threshold: it is the point at which the fix stops being cheaper than the context switch. A spotted issue that is logged as its own item does not block the work that found it, provided it is recorded before the merge.
|
||||
|
||||
---
|
||||
|
||||
### Burnout Prevention
|
||||
|
||||
**Plan at 80%.** Leave room for spotted issues, complexity, life.
|
||||
**Plan at 80%.** The Enabler sets the capacity plan per maker for each beat, at eighty percent of that maker's available working time, and the plan says what does not fit. Leave room for spotted issues, complexity, life.
|
||||
|
||||
**Protect exploration time.** One day per beat. No justification needed.
|
||||
**Protect exploration time.** A fifth of each maker's working time, moved to the next beat and recorded when the team is busy. No justification needed.
|
||||
|
||||
**Enforce boundaries.** No after-hours expectation. Vacation means offline. Mental health days need no explanation.
|
||||
|
||||
**Monitor health.** Every beat close: Did anyone crunch? Is anyone overwhelmed? Are boundaries respected?
|
||||
**Monitor health.** Every beat close: Did anyone crunch? Is anyone overwhelmed? Are boundaries respected? The warning signs and their thresholds are listed with the measurement rules.
|
||||
|
||||
**Cut scope, not sleep.** When deadlines conflict with capacity, the deadline yields or the scope shrinks. Never the person.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: measurement -->
|
||||
|
||||
### Accountability and Measurement
|
||||
|
||||
We promise outcomes and measure activity. This says which is which, who measures, and when.
|
||||
|
||||
This applies to every team that runs BEAT, for every beat. The Enabler owns the measurement for the beat; the team reviews it at the beat close and changes the measures it does not want.
|
||||
|
||||
**What is measured.** The outcome the team was set up to deliver, and whether the work landed. Not hours, not tasks completed, not points, not activity.
|
||||
|
||||
**Who measures.** The Enabler collects the evidence for the beat; the team reviews it at the beat close. The people who did the work do not report their own hours.
|
||||
|
||||
**When.** Once per beat, at the beat close, and immediately when a warning sign fires.
|
||||
|
||||
**Window.** The outcome is judged over the window in which it could have landed: the beat for most work, and longer for work that cannot land inside one beat.
|
||||
|
||||
**Warning signs and their thresholds.** Overtime in two consecutive beats, or WIP at the limit in two consecutive beats, or the same blocker unresolved across two beats, or a maker who has missed two check-ins in a row. Each one is discussed at the next beat close, and the response is written down there.
|
||||
|
||||
**Not a scorecard.** The measurement exists to change the plan. It is not a ranking of makers, it is not reported upward as a performance figure, and it is not used to compare teams.
|
||||
|
||||
**When an outcome is not observable.** Work whose outcome is not observable — support, infrastructure, research, maintenance — is measured by the change it produced and reviewed at the beat close. It is never measured by hours.
|
||||
|
||||
**The assessment on this site.** The self-assessment is a self-report. It has no validity evidence, it does not measure the outcomes above, and it is a starting point for a conversation rather than a measurement.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: customerFeedback -->
|
||||
|
||||
### Customer & User Feedback
|
||||
|
||||
Building in isolation produces irrelevant software. We stay connected to users:
|
||||
Work built away from users drifts away from what users need. We keep the line to users open. This section applies to every team that builds something users use. The team decides who reads user feedback; the Enabler makes sure the feedback reaches the makers who can act on it. A team with no direct user contact — an internal platform, for example — reads the requests of the teams that use it, and treats those requests as the user feedback.
|
||||
|
||||
**Direct access.** Makers should have direct access to user feedback—support tickets, analytics, user interviews. Not filtered through three layers of management.
|
||||
**Direct access.** Makers can read support tickets, analytics and user interviews without them being filtered through several layers of management.
|
||||
|
||||
**Regular exposure.** At least once per beat, someone on the team reviews real user feedback. Share highlights async.
|
||||
**Regular exposure.** At least once per beat, someone on the team reads real user feedback and shares the highlights asynchronously. The source is named, so a claim can be checked.
|
||||
|
||||
**Fast feedback loops.** Ship small. Learn fast. The best specification is user behavior. The best validation is real usage.
|
||||
**Small releases.** Ship in small pieces so real usage can answer the question the work was built on.
|
||||
|
||||
**User problems, not user solutions.** Users tell us what hurts. We decide how to fix it. Listen to the problem; be skeptical of the proposed solution.
|
||||
**Problems, not solutions.** Users describe what hurts them; the team decides how to fix it. The proposed solution is treated as one input, not as the answer.
|
||||
|
||||
**Close the loop.** When we ship something based on user feedback, tell them. "You asked, we built." This builds trust and invites more feedback.
|
||||
**Close the loop.** When a release answers a user request, the team tells the requester. That is how the next request arrives.
|
||||
|
||||
**What this is not.** This is a practice the team commits to, not a researched effect on delivery. It is written down because the team intends to do it, and it is reviewed like any other practice.
|
||||
|
||||
---
|
||||
|
||||
@@ -329,16 +383,16 @@ When production breaks, normal rules suspend temporarily:
|
||||
|
||||
**Incident protocol:**
|
||||
|
||||
1. **Alert** — Post immediately in dedicated incident channel. Phone/page if needed.
|
||||
2. **Acknowledge** — Someone claims ownership within 15 minutes.
|
||||
3. **Communicate** — Brief status updates every 30 minutes until resolved.
|
||||
4. **Fix** — Stabilize first, perfect later. Rollback is a valid fix.
|
||||
5. **Document** — Async post-mortem within 48 hours. No blame. Root cause and prevention.
|
||||
1. **Alert** — Post immediately in the incident channel. The on-call rota names who to call and the fallback when nobody answers.
|
||||
2. **Acknowledge** — Someone claims ownership within fifteen minutes of the alert, and becomes the incident lead for the rest of the incident.
|
||||
3. **Communicate** — Status updates every half hour until the incident is stable. The meeting budget does not apply during an incident; the incident lead decides when normal rules resume.
|
||||
4. **Fix** — Stabilize first, improve later. Rollback is a valid fix.
|
||||
5. **Document** — Async post-mortem within two days. No blame. Root cause and prevention, with the action items tracked to completion.
|
||||
|
||||
**During incidents:**
|
||||
- Sacred blocks are suspended
|
||||
- The incident lead may suspend a sacred block, and only for the time the incident runs
|
||||
- Sync communication is acceptable
|
||||
- Async rules resume once stable
|
||||
- Async rules resume when the incident lead says they do
|
||||
- Whoever is available helps—no "not my job"
|
||||
|
||||
**After incidents:**
|
||||
@@ -351,13 +405,83 @@ When production breaks, normal rules suspend temporarily:
|
||||
|
||||
---
|
||||
|
||||
<!-- id: onCall -->
|
||||
|
||||
### On-call and Incident Rotation
|
||||
|
||||
The incident protocol covers the incident. This covers the rota that carries it.
|
||||
|
||||
This applies to any service with a production path a customer depends on. The team that owns the service sets the rota; the Enabler keeps it staffed and the Connector keeps it written down. A service with no customer-facing failure mode needs no rota. A team too small to share the load covers it in named hours rather than shifts, and says so.
|
||||
|
||||
**Rotation.** The rota names one person per shift and one backup, published in the service documentation. The rota is set per beat and reviewed at each beat close.
|
||||
|
||||
**Handover.** Each handover is written: what is open, what is watching, what broke last time. The incoming shift reads it before the outgoing shift ends.
|
||||
|
||||
**Availability.** On-call means reachable during the shift, not watching screens. Outside the shift, a maker is offline and pages are not expected.
|
||||
|
||||
**Who may declare an incident.** Anyone may raise the alert; the on-call maker decides whether it meets the incident criteria, and the acknowledgement step makes that maker the incident lead.
|
||||
|
||||
**Inside or outside the beat.** On-call time is planned capacity, not overtime. The Enabler plans the on-call load into the beat and lowers the planned commitment of whoever is on.
|
||||
|
||||
**Compensation.** On-call time back is taken in time: the maker chooses the following working time they hand back, and the Enabler protects it.
|
||||
|
||||
**Escalation.** If the on-call maker cannot resolve within the acknowledgement window, they escalate to the backup, then to the incident lead named in the rota, then to the Enabler.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: timeZones -->
|
||||
|
||||
### Working across Time Zones
|
||||
|
||||
Every rule in BEAT that counts time runs on the team's stated coverage hours, in working hours. Here is the reference time zone those hours are counted in.
|
||||
|
||||
This applies to every rule measured in hours or days: response expectations, the review window, auto-proceed, stale items, daily merges and the daily check-in. The team names its reference time zone at the start of a beat; the Enabler records it with the beat goals. A team that spans zones unevenly picks the zone with the fewest members as the reference, or picks no reference and states each rule in absolute hours instead.
|
||||
|
||||
**Coverage hours.** The team states the hours it is covered, in the reference time zone, and publishes them. Outside those hours a maker is offline.
|
||||
|
||||
**Reference time zone.** One named time zone starts every clock in BEAT: the review window, auto-proceed, staleness and the daily merge. It is written down where the board lives.
|
||||
|
||||
**Overlap hours.** Ceremonies run inside the overlap between the zones they span. A ceremony that has no overlap is written instead, and read asynchronously.
|
||||
|
||||
**Handover.** The team that ends its day writes the state of open work before it ends, so the next team starts from the written state rather than from a message.
|
||||
|
||||
**Daily check-in.** The check-in is posted in the maker's own working day, not in the reference one. A maker whose day has barely started posts when it starts for them.
|
||||
|
||||
**Sacred blocks.** A maker's sacred block sits in their own working day. Nobody schedules into another maker's block, and a block in one zone is never a reason to be online in another.
|
||||
|
||||
**Urgent work across zones.** Urgency follows the rota, not the person who noticed. If nobody on the rota is in working hours, the issue waits unless it meets the incident criteria.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: crossTeamDependencies -->
|
||||
|
||||
### Dependencies across Teams
|
||||
|
||||
Escalation, connectors and interfaces all stop at the team boundary. Here is how work crosses it.
|
||||
|
||||
This applies to any work item that depends on another team, and any commitment this team makes to another team. The Enabler owns the dependency list; the team that owns the other side owns the work on their side. A dependency with no counterpart on the other side is escalated to the Connector, who finds an owner or says the work cannot proceed on that dependency.
|
||||
|
||||
**Naming the dependency.** An item with a dependency names the other team and the thing they owe: a decision, a date, an interface. "Blocked on platform" is not a dependency.
|
||||
|
||||
**Raising it.** The dependency is posted in the check-in the day it appears, not when it starts to hurt. The Enabler carries it to the other team's Enabler.
|
||||
|
||||
**Interfaces.** Agreed contracts are written before either side builds, and they are versioned. Changing an agreed interface is a change to both teams' plans, and both are told.
|
||||
|
||||
**Commitments to other teams.** A commitment this team makes to another team is recorded in the same place as the board, with the date and the owner, so it is not lost when the beat ends.
|
||||
|
||||
**Shared foundations.** A change to a shared library or platform that affects several teams is raised with all affected teams before it is scheduled, not after.
|
||||
|
||||
**When the other side does not answer.** An unanswered dependency is escalated by the Enabler to the other team's Enabler, and then to their manager. The team that is blocked records what it is not doing while it waits.
|
||||
|
||||
---
|
||||
|
||||
### Technical Practices (Optional)
|
||||
|
||||
BEAT does not prescribe technical practices. Teams choose what works for them. However, these practices align well with BEAT principles:
|
||||
BEAT does not prescribe technical practices. These apply to one repository or service, adopted by the team that owns it. The team that owns the code decides. A practice that only partly applies — automated testing on a codebase with no test harness, for example — is adopted in the part that applies, and the team writes down the part it defers and when it returns to it.
|
||||
|
||||
**Continuous Integration** — Merge frequently. Keep main deployable. Automated tests run on every push.
|
||||
|
||||
**Small Pull Requests** — Easier to review, faster to merge, lower risk. Aim for PRs reviewable in under 30 minutes.
|
||||
**Small Pull Requests** — Easier to review, faster to merge, lower risk. Aim for PRs a reviewer can read in one sitting — a BEAT default, not a measured threshold.
|
||||
|
||||
**Feature Flags** — Merge incomplete work safely. Decouple deployment from release. Enable experimentation.
|
||||
|
||||
@@ -365,12 +489,14 @@ BEAT does not prescribe technical practices. Teams choose what works for them. H
|
||||
|
||||
**Refactoring as You Go** — Leave code better than you found it. Small improvements compound. No permission needed.
|
||||
|
||||
**Trunk-Based Development** — Short-lived branches. Merge daily. Avoid long-running feature branches.
|
||||
**Trunk-Based Development** — Short-lived branches. Merge daily. Claim files in the branch protection rule before you start; when two makers claim the same file, the earlier claim stands and the later one re-plans around it. A day is a working day in the reference time zone.
|
||||
|
||||
These are not mandated. They are offered as practices that support focus, speed, and quality. Adopt what serves you. Discard what doesn't.
|
||||
|
||||
---
|
||||
|
||||
<!-- id: onboarding -->
|
||||
|
||||
## Onboarding to BEAT
|
||||
|
||||
When someone new joins a BEAT team:
|
||||
@@ -378,16 +504,17 @@ When someone new joins a BEAT team:
|
||||
### Week One: Observe
|
||||
|
||||
- Read this manifesto
|
||||
- Read the decision log, the architecture notes and the board history for the area you join
|
||||
- Shadow async check-ins and board activity
|
||||
- Observe one Beat Start and/or Beat Close
|
||||
- Get access to tools, repos, docs
|
||||
- Meet team members 1:1 (async or sync, their preference)
|
||||
- Meet team members one to one: the Connector or the Enabler arranges it, you choose the format and the time, and a written exchange counts as a meeting
|
||||
|
||||
### Week Two: Participate
|
||||
|
||||
- Pull first small task (S-sized)
|
||||
- Post first daily check-in
|
||||
- Submit first PR, experience review process
|
||||
- Submit first PR, and treat the first review as teaching rather than as the review window
|
||||
- Ask questions freely—in channel, not DMs (so others learn too)
|
||||
|
||||
### Week Three: Contribute
|
||||
@@ -405,11 +532,37 @@ When someone new joins a BEAT team:
|
||||
- Experienced one full beat cycle
|
||||
- Identified sacred block timing that works
|
||||
|
||||
### Reading List
|
||||
|
||||
- This manifesto
|
||||
- The decision log for the area you join: what was decided, by whom, and why
|
||||
- The architecture notes for the services you will touch
|
||||
- The board history for the last two beats: what was tried, what shipped, what was dropped
|
||||
|
||||
### Your First Review
|
||||
|
||||
- Your first pull request is reviewed for teaching, not against the review window
|
||||
- It does not auto-proceed: you ask a named maker for the review and you wait
|
||||
- After your first merged item, the review window applies to you like it does to everyone else
|
||||
|
||||
### When the Ramp Is Not Working
|
||||
|
||||
- Say so in the first week, not after the first month: the Connector or the Enabler adjusts the ramp or the plan
|
||||
- The Enabler re-scopes your first items until they fit the time you actually have
|
||||
- If the ramp is still blocked two weeks in, the Enabler raises it at the next beat close and the team changes the plan
|
||||
- You may decline work, meetings and on-call during the ramp, and the team plans around that
|
||||
|
||||
### On Junior-Heavy Teams
|
||||
|
||||
- Where BEAT fits poorly is on junior-heavy teams that need close guidance, so those teams add a mentor on top of this ramp
|
||||
- The mentor is a named maker who reviews the new member's first items and answers questions in working hours
|
||||
- The mentor's time is planned capacity like any other work, not an overflow
|
||||
- The ramp lengthens: the new member pulls feature work only after the first month
|
||||
|
||||
### Connector's Responsibility
|
||||
|
||||
The Connector (or Enabler if no Connector) ensures:
|
||||
- Documentation is current and findable
|
||||
- New member has a "buddy" for questions (informal, not mandatory pairing)
|
||||
- First tasks are well-scoped and achievable
|
||||
- Overwhelm is caught early
|
||||
|
||||
@@ -418,7 +571,7 @@ The Connector (or Enabler if no Connector) ensures:
|
||||
- Throw new members into complex work immediately
|
||||
- Expect full productivity in week one
|
||||
- Leave people to figure it out alone
|
||||
- Assign mandatory onboarding buddies for months
|
||||
- Assign a mandatory buddy for months
|
||||
|
||||
Onboarding should feel like a gradual ramp, not a firehose or an abandonment.
|
||||
|
||||
@@ -435,7 +588,7 @@ Common ways teams fail at BEAT:
|
||||
| **Async theater** | Writing decisions but ignoring comments | Genuine engagement or revert to sync |
|
||||
| **Sacred block erosion** | "Quick calls" during focus time | Enabler enforces boundaries |
|
||||
| **Check-in decay** | Updates become sporadic, then stop | Address in retro, understand why |
|
||||
| **Permanent NOW** | Everything is urgent, always | If everything is NOW, nothing is |
|
||||
| **Permanent NOW** | Everything is urgent, always | If everything is NOW, nothing is. The Enabler returns items to NEXT until the bucket is inside its limit |
|
||||
| **Grooming creep** | Meetings sneak back in disguised | Ask: could this be async? |
|
||||
| **Document graveyard** | Docs written but never maintained | Connector role, or delete stale docs |
|
||||
|
||||
@@ -446,7 +599,7 @@ Common ways teams fail at BEAT:
|
||||
| **Hero culture** | Same person handles all crises | Rotate, distribute, investigate cause |
|
||||
| **Silent struggle** | Maker stuck for days, says nothing | Normalize asking for help early |
|
||||
| **Autonomy hoarding** | One maker claims all interesting work | Discuss in retro, Enabler balances |
|
||||
| **Review blocking** | PRs languish waiting for "the" reviewer | Anyone can review, auto-proceed rule |
|
||||
| **Review blocking** | PRs languish waiting for "the" reviewer | Anyone can review, auto-proceed rule, with the exceptions in the review rule |
|
||||
| **Passive Enabler** | Enabler doesn't shield or prioritize | Role clarity, or rotate role |
|
||||
|
||||
### Organizational Anti-Patterns
|
||||
@@ -454,7 +607,7 @@ Common ways teams fail at BEAT:
|
||||
| Anti-Pattern | What It Looks Like | The Fix |
|
||||
|--------------|-------------------|---------|
|
||||
| **Management override** | Exec demands meeting during sacred block | Enabler pushes back, escalates pattern |
|
||||
| **Stealth deadlines** | Surprise "we promised client by Friday" | Surface commitments before making them |
|
||||
| **Stealth deadlines** | Surprise "we promised client by Friday" | Surface commitments before making them. A commitment already made outside the team is renegotiated by whoever made it, with the Enabler helping, and the team hears about it before the next beat starts |
|
||||
| **Metric theater** | Tracking velocity, points, hours | Stop. Measure outcomes, not activity. |
|
||||
| **BEAT in name only** | Ceremonies adopted, principles ignored | Re-read manifesto, recommit or don't claim BEAT |
|
||||
|
||||
@@ -462,50 +615,55 @@ Common ways teams fail at BEAT:
|
||||
|
||||
Signs the methodology isn't serving the team:
|
||||
|
||||
- Burnout despite 80% planning
|
||||
- Overtime in two consecutive beats
|
||||
- WIP at the limit in two consecutive beats
|
||||
- The same blocker unresolved across two beats
|
||||
- A maker who has missed two check-ins in a row
|
||||
- Decisions taking too long async
|
||||
- Quality declining
|
||||
- Team feeling disconnected
|
||||
- Makers disengaged from beat goals
|
||||
|
||||
**Response:** Discuss in Beat Close. Adapt the framework. BEAT is a tool, not a religion. If it's not working, change it or choose something else.
|
||||
**Response:** Each of these is discussed at the next beat close, with the response written down there, and the plan is changed where it is the plan that failed. BEAT is a tool, not a religion. If it's not working, change it or choose something else.
|
||||
|
||||
---
|
||||
|
||||
## What We Have Learned
|
||||
|
||||
BEAT emerges from research on how developers actually work:
|
||||
Some of what follows comes from published work, with the source named. The rest is what we have seen in the teams that run BEAT — our own observations, not research findings.
|
||||
|
||||
- Developers trend toward introversion and need low-stimulation focus time
|
||||
- Deep focus requires 52 minutes to reach and 23 minutes to recover from interruption
|
||||
- More than two meetings per day reduces productive output to 14%
|
||||
- Peak cognitive work capacity is approximately four hours per day
|
||||
- 72% of meetings are ineffective at their stated purpose
|
||||
- Autonomy, competence, and relatedness drive intrinsic motivation
|
||||
- Resuming interrupted work takes about twenty-five minutes [mark-2005]
|
||||
- The most productive users tracked by DeskTime worked in blocks of fifty-two minutes, and about 3 hours 43 minutes of focused work per day for the top performers [desktime-2014]
|
||||
- Seventy-one percent of 182 surveyed senior managers described their meetings as unproductive or inefficient [rogelberg-2019]
|
||||
- Companies that tried a meeting-free Wednesday reported a productivity gain of up to 73% [mit-sloan-2017]
|
||||
- Knowledge workers surveyed reported lower productivity above two hours a day in meetings [slack-workplace-lab-2017]
|
||||
- Autonomy, competence and relatedness are the needs that make sustained motivation possible [deci-ryan-2000] — a general motivation theory, not a result about developers
|
||||
|
||||
We built BEAT for these realities, not against them.
|
||||
And what we have observed ourselves: developers we work with ask for long stretches of low-stimulation time; the work that ships is the work nobody interrupted; teams that protect focus get their work done, while teams that spend the week in meetings do not. We built BEAT for these realities, not against them. Every number in the constraints table is a BEAT default chosen by the BEAT authors — the cited research informs the direction, not the numbers.
|
||||
|
||||
---
|
||||
|
||||
## Where BEAT Fits
|
||||
|
||||
BEAT works best for:
|
||||
These are the contexts we have seen BEAT used in, not a researched fit. The list records our practice; it is not a finding about what improves delivery.
|
||||
|
||||
- Remote-first or distributed teams
|
||||
- Senior and mid-level developers
|
||||
- Product companies
|
||||
- Teams of 3-8 people
|
||||
- High-trust environments
|
||||
- Async-native cultures
|
||||
BEAT has worked for us in:
|
||||
|
||||
BEAT fits poorly for:
|
||||
- Remote-first or distributed teams, where written work carries the team across time zones
|
||||
- Senior and mid-level developers, who need protection more than supervision
|
||||
- Product companies, where the work is decided in the open
|
||||
- Teams of three to eight people, where one Enabler can still hold the whole board
|
||||
- High-trust environments, where the Enabler can order without a mandate
|
||||
- Async-native cultures, where writing is already the default
|
||||
|
||||
- Junior-heavy teams needing close guidance
|
||||
- Regulated industries requiring ceremony
|
||||
- Agency work with constant client sync
|
||||
BEAT has fitted poorly in:
|
||||
|
||||
- Junior-heavy teams needing close guidance, unless the team adds a mentor alongside the BEAT ramp
|
||||
- Regulated industries requiring ceremony that BEAT does not provide
|
||||
- Agency work with constant client sync, where the client calendar sets the meeting budget
|
||||
- Organizations unwilling to protect focus time
|
||||
|
||||
BEAT can adapt for:
|
||||
BEAT has been adapted for:
|
||||
|
||||
- Incident response (see Incidents section)
|
||||
- Mixed seniority (extra onboarding support)
|
||||
@@ -519,7 +677,7 @@ Know your context. Adapt accordingly.
|
||||
|
||||
By adopting BEAT, we commit to:
|
||||
|
||||
**Protecting focus** — We will not interrupt sacred time. We will wait.
|
||||
**Protecting focus** — We will not interrupt sacred time. We will wait. The one exception is a declared incident, and the incident lead decides when the block resumes.
|
||||
|
||||
**Defaulting to async** — We will write first, meet only when writing fails.
|
||||
|
||||
@@ -531,6 +689,20 @@ By adopting BEAT, we commit to:
|
||||
|
||||
---
|
||||
|
||||
<!-- id: assessment-scoring -->
|
||||
|
||||
## The Self-Assessment
|
||||
|
||||
The site publishes a self-assessment: a short questionnaire a team fills in about its own practice, scored into four categories — focus, communication, autonomy and sustainability — and then into an overall band.
|
||||
|
||||
**How it is scored.** Every question is worth 0 to 4 points, and each category carries three questions, so the maximum score is 48. The thresholds are BEAT's own scoring rule, not a research finding: a category is low below 40 percent of its maximum, medium from 40 to 70 percent, and high above 70 percent. The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, and high 43 to 48.
|
||||
|
||||
<!-- id: assessment-validity -->
|
||||
|
||||
**What it measures.** This is a self-report with no published validity evidence. It measures what a team believes about its own practice, not delivery, quality or wellbeing. Use it to start a conversation and to compare your own score over time, not as a benchmark against other teams.
|
||||
|
||||
---
|
||||
|
||||
## In Summary
|
||||
|
||||
```
|
||||
@@ -558,7 +730,7 @@ We ship and learn.
|
||||
| Written documentation | Verbal agreements |
|
||||
| Individual autonomy | Prescribed processes |
|
||||
| Sustainable pace | Heroic effort |
|
||||
| Small experiments | Perfect plans |
|
||||
| Small experiments | Careful plans |
|
||||
|
||||
### The Team Values
|
||||
|
||||
@@ -572,17 +744,19 @@ We ship and learn.
|
||||
|
||||
### The Numbers
|
||||
|
||||
Every limit below is a BEAT default chosen by the BEAT authors. None of them is a research finding; the cited research informs the direction, not these numbers.
|
||||
|
||||
| Constraint | Limit |
|
||||
|------------|-------|
|
||||
| Sacred block | 4 hours daily |
|
||||
| Meetings per week | ≤2 hours total |
|
||||
| Meeting duration | ≤1 hour each |
|
||||
| WIP per maker | 3 items |
|
||||
| Planning capacity | 80% |
|
||||
| Exploration time | 20% (1 day/beat) |
|
||||
| NOW items | Max 3-5 |
|
||||
| Review response | 4 hours |
|
||||
| Auto-proceed | 24 hours |
|
||||
| Planning capacity | 80% of available working time |
|
||||
| Exploration time | 20% of working time |
|
||||
| NOW items | Max 5 |
|
||||
| Review response | 4 working hours |
|
||||
| Auto-proceed | 24 working hours |
|
||||
|
||||
### The Buckets
|
||||
|
||||
@@ -615,11 +789,17 @@ We ship and learn.
|
||||
```
|
||||
Code:
|
||||
✓ Works as intended
|
||||
✓ Tests pass
|
||||
✓ Code reviewed
|
||||
✓ Merged to main
|
||||
✓ Deployable
|
||||
✓ No known defects
|
||||
✓ Tests pass: the existing suite passes, and new behaviour carries a
|
||||
test unless the team has agreed an exception for it, which the
|
||||
Enabler records
|
||||
✓ Reviewed by at least one other maker, or auto-proceeded under the
|
||||
review rule with the exceptions in that rule named in the merge
|
||||
✓ Merged to main branch
|
||||
✓ Deployable: the artefact builds and runs for the team's own use, and
|
||||
is deployed where the team deploys its own work
|
||||
✓ No known defects introduced: a defect found during the work and
|
||||
logged as its own item does not block this one, provided it is
|
||||
recorded before the merge
|
||||
```
|
||||
|
||||
### Daily Check-in Template
|
||||
@@ -648,6 +828,25 @@ Critical? → Flag team
|
||||
5. Document (within 48 hrs)
|
||||
```
|
||||
|
||||
### The Self-Assessment
|
||||
|
||||
```
|
||||
Categories: focus, communication, autonomy, sustainability
|
||||
Questions per category: 3
|
||||
Points per question: 0 to 4
|
||||
Maximum score: 48
|
||||
|
||||
Category band: low below 40% of its maximum,
|
||||
medium from 40% to 70%,
|
||||
high above 70%
|
||||
Overall band: low 12 to 24
|
||||
medium 25 to 36
|
||||
strong 37 to 42
|
||||
high 43 to 48
|
||||
```
|
||||
|
||||
The scoring rule is BEAT's own, not a research finding. The assessment is a self-report with no published validity evidence: it measures what a team believes about its own practice, not delivery, quality or wellbeing. Use it to start a conversation and to compare your own score over time, not as a benchmark against other teams.
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
@@ -656,6 +855,21 @@ This manifesto is open for use and adaptation.
|
||||
|
||||
Attribution appreciated. Improvement welcomed. Dogma discouraged.
|
||||
|
||||
The weak-point review of this manifesto — every unsupported claim, wrong number, contradiction, uncovered situation and rule that cannot be applied as written, with the resolution made for each — is recorded in [docs/weak-points.md](docs/weak-points.md).
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
Every inline citation above points to an entry here. The ids are the ones the site uses, so a claim can be checked against the same source from either side.
|
||||
|
||||
- **[deci-ryan-2000]** Deci, E. L., & Ryan, R. M. (2000). "The 'what' and 'why' of goal pursuits: Human needs and the self-determination of behavior." *Psychological Inquiry*, 11(4), 227–268. DOI: [10.1207/S15327965PLI1104_01](https://doi.org/10.1207/S15327965PLI1104_01). — Cited for the motivation claim only: autonomy, competence and relatedness as basic psychological needs. A general motivation theory, not a finding about developers.
|
||||
- **[mark-2005]** Mark, G., González, V. M., & Hessian, J. (2005). "No Task Left Behind? Examining the Nature of Multitasking." *Proceedings of CHI 2005*, 1529–1537. DOI: [10.1145/1060759.1060818](https://doi.org/10.1145/1060759.1060818). — Reports roughly twenty-five minutes to return to an interrupted task.
|
||||
- **[desktime-2014]** DeskTime (2014). Analysis of its own tracked users: the most productive tenth of users worked in blocks of 52 minutes followed by 17-minute breaks. — DeskTime blog, 2014. DeskTime is the publisher of the study, so no third-party DOI exists; the blog post is the published work. The 52-minute figure is the length of a productive work block, not the time it takes to reach focus. The same analysis reports about 3 hours 43 minutes of focused work per day for the top performers.
|
||||
- **[mit-sloan-2017]** MIT Sloan Management Review (2017). "Meeting-Free Wednesdays": study of 76 companies that tried a meeting-free Wednesday. — MIT Sloan Management Review, 2017 issue. Reported an increase in productivity of up to 73% and a drop in stress of 57% in the participating companies. Self-reported by the companies, so it is a practice report, not a controlled trial.
|
||||
- **[rogelberg-2019]** Rogelberg, S. (2019). *The Surprising Science of Meetings: How You Can Lead Your Team to Peak Performance*. Oxford University Press. ISBN 978-0-19-008948-7. — Reports that 71% of 182 surveyed senior managers described their meetings as unproductive or inefficient. The survey asked whether meetings were unproductive and inefficient, not whether they failed at their stated purpose.
|
||||
- **[slack-workplace-lab-2017]** Slack Workplace Lab (2017). Survey of knowledge workers on meeting load and productivity. — Slack Workplace Lab research report, 2017. Found that spending more than two hours a day in meetings was associated with lower productivity. It reports no percentage drop in output, so no figure of that kind is quoted in this manifesto.
|
||||
|
||||
---
|
||||
|
||||
*BEAT v1.0*
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# Information architecture
|
||||
|
||||
The site is one document — the BEAT manifesto — split into pages. This document lists the sections and pages, their order and their purpose. It is the reference for the router (`public/src/router/index.js`), the header navigation and the section navigation.
|
||||
|
||||
The route table below is the source of truth for paths, page titles and section membership. The router exports the same data as `sections` and per-route `meta`, so no other file hard-codes a section list.
|
||||
|
||||
## Sections
|
||||
|
||||
Sections group pages by the question a reader asks. The order is the reading order.
|
||||
|
||||
| Order | Section id | Label | Question it answers |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | `start` | Start | What is BEAT and where do I begin? |
|
||||
| 2 | `foundations` | Foundations | What does BEAT value and what does it claim? |
|
||||
| 3 | `method` | The Method | How does a BEAT team plan and work? |
|
||||
| 4 | `applying` | Applying BEAT | How does a team adopt BEAT and check that it works? |
|
||||
| 5 | `reference` | Reference | What are the numbers, roles and templates? |
|
||||
|
||||
## Pages
|
||||
|
||||
| Section | Order in section | Path | Page title (`meta.title`) | Purpose |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `start` | 1 | `/` | Home | State the manifesto, the core values and the commitment, and offer the two next steps: read the values or assess the team. |
|
||||
| `foundations` | 1 | `/foundations/values` | Values | List the core values and the five team values, with the behaviour each value requires. |
|
||||
| `foundations` | 2 | `/foundations/principles` | Principles | State the twelve principles in four groups (focus, communication, autonomy, sustainability) and their summary. |
|
||||
| `method` | 1 | `/method/framework` | The Framework | Define roles, beats, work items, prioritisation buckets, the board and the planning numbers. |
|
||||
| `method` | 2 | `/method/practices` | Practices | Define meetings, the daily check-in, collaboration, the definition of done, incident handling and optional technical practices. |
|
||||
| `applying` | 1 | `/applying/onboarding` | Onboarding | Give a three-week onboarding path and the first-month expectations for a new maker and for the connector. |
|
||||
| `applying` | 2 | `/applying/anti-patterns` | Anti-Patterns | Name process, people and organisational anti-patterns, when BEAT is not working, and where the method fits. |
|
||||
| `applying` | 3 | `/applying/assessment` | Team Assessment | Let a team score itself against the principles and read the result. |
|
||||
| `reference` | 1 | `/reference` | Quick Reference | Collect the values, numbers, buckets, roles, ceremonies, templates, definition of done and incident protocol for lookup. |
|
||||
| `start` | 99 | catch-all | Page not found | Answer an unknown path with the not-found page. |
|
||||
|
||||
The catch-all is a page in the `start` section for routing purposes only; it does not appear in the section navigation.
|
||||
|
||||
## URL compatibility
|
||||
|
||||
Every path published before the redesign stays valid. The old flat paths are declared as aliases of the new pages, so a request to an old path renders its new page without a second navigation. The pre-redesign list is in `docs/pre-redesign-routes.md`.
|
||||
|
||||
| Old path | New path |
|
||||
| --- | --- |
|
||||
| `/` | `/` |
|
||||
| `/values` | `/foundations/values` |
|
||||
| `/principles` | `/foundations/principles` |
|
||||
| `/framework` | `/method/framework` |
|
||||
| `/practices` | `/method/practices` |
|
||||
| `/onboarding` | `/applying/onboarding` |
|
||||
| `/anti-patterns` | `/applying/anti-patterns` |
|
||||
| `/assessment` | `/applying/assessment` |
|
||||
| `/reference` | `/reference` |
|
||||
|
||||
## Wayfinding
|
||||
|
||||
- The header navigation lists the five sections in `order`, built from the `sections` export.
|
||||
- The section navigation lists the pages of the current section, ordered by `meta.sectionOrder`, filtered by `meta.section`.
|
||||
- Every page has a unique `meta.title` in the router; the document title and the page heading take their text from it.
|
||||
- Both navigations must be persistent on every page and keyboard operable. The components that render them live in `public/src/components/layout`; this document fixes their data, not their markup.
|
||||
|
||||
## Route contract
|
||||
|
||||
Each page route in `public/src/router/index.js` carries:
|
||||
|
||||
- `meta.title` — unique per page, used for the document title and the page heading.
|
||||
- `meta.section` — one of the section ids above.
|
||||
- `meta.sectionOrder` — the page's position inside its section.
|
||||
|
||||
The catch-all route carries the same keys so that every route has a title and a section.
|
||||
@@ -0,0 +1,67 @@
|
||||
# Pre-redesign routes
|
||||
|
||||
Baseline captured from the repository before any route was changed, at commit `9560c2c` (2026-11-02). This document is the "before" list that the URL-compatibility check measures against. Do not rewrite it after the router changes.
|
||||
|
||||
## How this list was captured
|
||||
|
||||
- Router: `public/src/router/index.js` at the baseline commit (all `path` values in the `routes` array).
|
||||
- Site links: every link target in `README.md` and every internal link in `public/src` (`RouterLink` targets and hard-coded path strings).
|
||||
- Deploy: `.github/workflows/deploy.yml` (build and publish steps) and `public/vite.config.js` (base URL and history mode).
|
||||
|
||||
## Published URL form
|
||||
|
||||
The site uses Vue Router hash history (`createWebHashHistory`) with Vite `base: './'`, and the GitHub Pages workflow publishes the contents of `public/dist` (`actions/upload-pages-artifact` with `path: ./public/dist`). A route therefore reaches the browser as the page URL plus a fragment:
|
||||
|
||||
```
|
||||
https://<owner>.github.io/<repo>/#<route-path>
|
||||
```
|
||||
|
||||
The hash fragment is resolved by the app, so every route below is a client-side path. No `404.html` file and no catch-all route existed at the baseline, so an unknown fragment rendered the app shell with an empty router view.
|
||||
|
||||
## Routes defined by the router
|
||||
|
||||
| Path | Route name | View component |
|
||||
| --- | --- | --- |
|
||||
| `/` | `Home` | `@/views/HomeView.vue` |
|
||||
| `/values` | `Values` | `@/views/ValuesView.vue` |
|
||||
| `/principles` | `Principles` | `@/views/PrinciplesView.vue` |
|
||||
| `/framework` | `Framework` | `@/views/FrameworkView.vue` |
|
||||
| `/practices` | `Practices` | `@/views/PracticesView.vue` |
|
||||
| `/onboarding` | `Onboarding` | `@/views/OnboardingView.vue` |
|
||||
| `/anti-patterns` | `AntiPatterns` | `@/views/AntiPatternsView.vue` |
|
||||
| `/reference` | `Reference` | `@/views/ReferenceView.vue` |
|
||||
| `/assessment` | `Assessment` | `@/views/AssessmentView.vue` |
|
||||
|
||||
Source: `git show 9560c2c:public/src/router/index.js`.
|
||||
|
||||
## Paths linked from README.md
|
||||
|
||||
`README.md` contains one Markdown link, `[docs/weak-points.md](docs/weak-points.md)`, which points at a repository file, not a site route. It contains no links to the published site and no route paths. The route list above is therefore the complete set of published paths at the baseline.
|
||||
|
||||
Source: `grep -n "](\|https\?://" README.md` returns only that link.
|
||||
|
||||
## Paths referenced by the GitHub Pages workflow
|
||||
|
||||
`.github/workflows/deploy.yml` references no individual route. It references the build output directory only:
|
||||
|
||||
- `working-directory: ./public` with `npm ci` and `npm run build`
|
||||
- `path: ./public/dist` for `actions/upload-pages-artifact@v3`
|
||||
|
||||
The output directory must stay `public/dist`.
|
||||
|
||||
## Internal links that point at these routes
|
||||
|
||||
These are the in-app links at the baseline. They must keep resolving after the restructure.
|
||||
|
||||
- `public/src/components/layout/NavBar.vue`: `/`, `/values`, `/principles`, `/framework`, `/practices`, `/onboarding`, `/anti-patterns`, `/reference`, `/assessment`
|
||||
- `public/src/components/layout/Footer.vue`: `/`, `/values`, `/principles`, `/framework`, `/reference`, `/assessment`, `/anti-patterns`, `/onboarding`, `/practices`
|
||||
- `public/src/views/HomeView.vue`: `/values`, `/principles`, `/framework`, `/practices`, `/onboarding`, `/reference`, `/assessment`
|
||||
- `public/src/views/AssessmentView.vue`: `/values`
|
||||
|
||||
## Path-like references outside the router
|
||||
|
||||
- `public/index.html` loads the favicon from the absolute path `/favicon.svg`. It is a static asset in `public/public/favicon.svg`, not a route, and is recorded here only because it is the one other path literal the published page references. Vite rewrites it to `./favicon.svg` in the built output, as `grep -o 'href="[^"]*favicon[^"]*"' public/dist/index.html` shows.
|
||||
|
||||
## Compatibility requirement
|
||||
|
||||
Every path in the table under "Routes defined by the router" must resolve to its intended page after the redesign: either unchanged, or through a redirect or alias declared in `public/src/router/index.js`.
|
||||
@@ -0,0 +1,166 @@
|
||||
# Section and principle map
|
||||
|
||||
The BEAT manifesto exists twice: as `README.md` and as the site content in `public/src/data`. This document is the committed map between the two. Every section and every principle carries an id; this table gives, for each id, the README heading it sits on, the line of the README anchor that marks it, and the site data key that holds it.
|
||||
|
||||
The map is the reference for the consistency check that confirms no section or principle exists on only one side. It is generated from the files, not from memory: the README side is the set of `<!-- id: xxx -->` HTML comment anchors in `README.md`, and the data side is the `sectionMap` export in `public/src/data/manifesto.js` (line 239).
|
||||
|
||||
## How to read the table
|
||||
|
||||
- **Id** — the shared identifier. It is the text inside the README's `<!-- id: xxx -->` comment and the `id` field in the data's `sectionMap`. It appears in neither rendered output, so the id can change without changing what a reader sees.
|
||||
- **README heading** — the Markdown heading the id belongs to, with its heading level and line number.
|
||||
- **Anchor line** — the line of the `<!-- id: xxx -->` comment in `README.md`.
|
||||
- **Anchor marks** — what the anchor introduces. For eleven ids this is the heading itself, one blank line below the anchor. For the two assessment ids it is a paragraph, and the row says which.
|
||||
- **Site data key** — the path to the data that holds the same content, relative to `public/src/data/manifesto.js` or `public/src/data/assessment.js`.
|
||||
|
||||
## The map
|
||||
|
||||
| Id | README heading | Anchor line | Anchor marks | Site data key |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `principle-focus` | `On Focus` (H3, line 53) | line 51 | the heading | `principles.focus` |
|
||||
| `principle-communication` | `On Communication` (H3, line 71) | line 69 | the heading | `principles.communication` |
|
||||
| `principle-autonomy` | `On Autonomy` (H3, line 89) | line 87 | the heading | `principles.autonomy` |
|
||||
| `principle-sustainability` | `On Sustainability` (H3, line 107) | line 105 | the heading | `principles.sustainability` |
|
||||
| `section-method` | `The Framework` (H2, line 125) | line 123 | the heading | `framework` |
|
||||
| `measurement` | `Accountability and Measurement` (H3, line 330) | line 328 | the heading | `measurement` |
|
||||
| `customerFeedback` | `Customer & User Feedback` (H3, line 356) | line 354 | the heading | `customerFeedback` |
|
||||
| `onCall` | `On-call and Incident Rotation` (H3, line 410) | line 408 | the heading | `onCall` |
|
||||
| `timeZones` | `Working across Time Zones` (H3, line 434) | line 432 | the heading | `timeZones` |
|
||||
| `crossTeamDependencies` | `Dependencies across Teams` (H3, line 458) | line 456 | the heading | `crossTeamDependencies` |
|
||||
| `onboarding` | `Onboarding to BEAT` (H2, line 500) | line 498 | the heading | `onboarding` |
|
||||
| `assessment-scoring` | `The Self-Assessment` (H2, line 694) | line 692 | the heading; the scoring rule is the paragraph `**How it is scored.**` at line 698 | `overallAssessment.scoring` |
|
||||
| `assessment-validity` | `The Self-Assessment` (H2, line 694) | line 700 | the paragraph `**What it measures.**` at line 702, under that heading | `overallAssessment.validity` |
|
||||
|
||||
Thirteen ids, one row each. The two assessment ids share the `## The Self-Assessment` heading. `assessment-scoring` marks the scoring rule in the paragraph at `README.md:698`; `assessment-validity` marks the validity note in the paragraph at `README.md:702`. Neither paragraph is a heading, so `assessment-validity` has no heading of its own — it is anchored to the section heading that contains it, and the row says so.
|
||||
|
||||
## The five named situations
|
||||
|
||||
The brief for this project names five situations the method must cover: incidents and on-call, time zones, onboarding, cross-team dependencies, and accountability and measurement. Each has a dedicated subsection on both sides.
|
||||
|
||||
| Situation | Id | README heading and line | Site data key | Data export at |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Incidents and on-call | `onCall` | `On-call and Incident Rotation`, `README.md:410` | `onCall` | `manifesto.js:593` |
|
||||
| Time zones | `timeZones` | `Working across Time Zones`, `README.md:434` | `timeZones` | `manifesto.js:628` |
|
||||
| Cross-team dependencies | `crossTeamDependencies` | `Dependencies across Teams`, `README.md:458` | `crossTeamDependencies` | `manifesto.js:667` |
|
||||
| Accountability and measurement | `measurement` | `Accountability and Measurement`, `README.md:330` | `measurement` | `manifesto.js:702` |
|
||||
| Onboarding | `onboarding` | `Onboarding to BEAT`, `README.md:500` | `onboarding` | `manifesto.js:441` |
|
||||
|
||||
### `customerFeedback` is not one of the five
|
||||
|
||||
`customerFeedback` (`Customer & User Feedback`, `README.md:356`, data key `customerFeedback`, export at `manifesto.js:741`) is a **sixth section**, not one of the five named situations. It is in the map for completeness, because it exists on both sides and the consistency check compares it like any other id. It must not be counted or presented as one of the five situations.
|
||||
|
||||
## Id sets found on each side
|
||||
|
||||
Collected from the files at the branch head, not from the brief.
|
||||
|
||||
**README side** — the `<!-- id: xxx -->` anchors in `README.md` (13):
|
||||
|
||||
```
|
||||
assessment-scoring
|
||||
assessment-validity
|
||||
crossTeamDependencies
|
||||
customerFeedback
|
||||
measurement
|
||||
onCall
|
||||
onboarding
|
||||
principle-autonomy
|
||||
principle-communication
|
||||
principle-focus
|
||||
principle-sustainability
|
||||
section-method
|
||||
timeZones
|
||||
```
|
||||
|
||||
**Data side** — the `sectionMap` export in `public/src/data/manifesto.js` (13), including the four principle rows that `sectionMap` spreads in from `principleSections` (`manifesto.js:45-50`):
|
||||
|
||||
```
|
||||
assessment-scoring
|
||||
assessment-validity
|
||||
crossTeamDependencies
|
||||
customerFeedback
|
||||
measurement
|
||||
onCall
|
||||
onboarding
|
||||
principle-autonomy
|
||||
principle-communication
|
||||
principle-focus
|
||||
principle-sustainability
|
||||
section-method
|
||||
timeZones
|
||||
```
|
||||
|
||||
**Intersection** — all 13 ids are on both sides:
|
||||
|
||||
```
|
||||
assessment-scoring
|
||||
assessment-validity
|
||||
crossTeamDependencies
|
||||
customerFeedback
|
||||
measurement
|
||||
onCall
|
||||
onboarding
|
||||
principle-autonomy
|
||||
principle-communication
|
||||
principle-focus
|
||||
principle-sustainability
|
||||
section-method
|
||||
timeZones
|
||||
```
|
||||
|
||||
**One-sided ids** — none.
|
||||
|
||||
```
|
||||
README-only: (none)
|
||||
Data-only: (none)
|
||||
```
|
||||
|
||||
Every id the data side exposes has a README anchor, and every README anchor has a data key. No id exists on only one side.
|
||||
|
||||
### Ids that are out of scope
|
||||
|
||||
Other id namespaces exist in the repository. They are not section or principle ids and are not part of this map.
|
||||
|
||||
| Namespace | Where | Examples |
|
||||
| --- | --- | --- |
|
||||
| Citation keys | `public/src/data/references.js` | `mark-2005`, `desktime-2014`, `rogelberg-2019`, `deci-ryan-2000`, `mit-sloan-2017`, `slack-workplace-lab-2017` |
|
||||
| Assessment category ids | `public/src/data/assessment.js:3-28` | `focus`, `communication`, `autonomy`, `sustainability` |
|
||||
| Site navigation section ids | `public/src/router/index.js:5-9` | `start`, `foundations`, `method`, `applying`, `reference` |
|
||||
|
||||
The four assessment category ids (`focus`, `communication`, `autonomy`, `sustainability`) are the categories the twelve principles are scored under. They are not the same ids as `principle-focus` and friends, and are deliberately not mapped here.
|
||||
|
||||
## Notes on the two sides
|
||||
|
||||
### Heading text differs by letter case in five rows
|
||||
|
||||
The README uses title case for its headings; `sectionMap` records the sentence case used by the data structures. The content is the same section in both cases. This is a difference in label text, not a one-sided id.
|
||||
|
||||
| Id | README heading | `sectionMap` heading |
|
||||
| --- | --- | --- |
|
||||
| `measurement` | Accountability and Measurement | Accountability and measurement |
|
||||
| `onCall` | On-call and Incident Rotation | On-call and incident rotation |
|
||||
| `timeZones` | Working across Time Zones | Working across time zones |
|
||||
| `crossTeamDependencies` | Dependencies across Teams | Dependencies across teams |
|
||||
| `assessment-scoring` | The Self-Assessment | Assessment scoring |
|
||||
| `assessment-validity` | The Self-Assessment (paragraph `What it measures.`) | Assessment validity |
|
||||
|
||||
The last two are not case differences: the data side names the two paragraphs by what they hold, while the README has one heading with two paragraphs under it.
|
||||
|
||||
### The `framework` subsection lists differ in order and in one member
|
||||
|
||||
`framework.subsections` (`manifesto.js:210-232`) lists 21 names. The README's `## The Framework` section carries 20 `###` headings between `README.md:125` and `README.md:498`.
|
||||
|
||||
- `Onboarding to BEAT` is a member of `framework.subsections` and is a top-level `##` heading in the README, not a `###` under `## The Framework`. It is mapped here under its own id, `onboarding`.
|
||||
- The two lists also order the same names differently. The data order is `Customer & User Feedback`, `Incidents & Emergencies`, `Technical Practices (Optional)`, `On-call and incident rotation`, `Working across time zones`, `Dependencies across teams`, `Accountability and measurement`, `Onboarding to BEAT`. The README order is `Accountability and Measurement`, `Customer & User Feedback`, `Incidents & Emergencies`, `On-call and Incident Rotation`, `Working across Time Zones`, `Dependencies across Teams`, `Technical Practices (Optional)`.
|
||||
|
||||
No name is present in one list and missing from the other, other than `Onboarding to BEAT` as described. The map is by id, so the ordering difference does not make an id one-sided.
|
||||
|
||||
## Verification
|
||||
|
||||
The commands that produced the id sets and the table, run at the branch head:
|
||||
|
||||
```sh
|
||||
grep -n '<!-- id:' README.md
|
||||
grep -n '^export const' public/src/data/manifesto.js public/src/data/assessment.js
|
||||
sed -n '239,250p' public/src/data/manifesto.js
|
||||
```
|
||||
|
||||
The consistency check script that reads this map is owned by another card. It must report zero one-sided ids against the sets above.
|
||||
@@ -0,0 +1,214 @@
|
||||
# Theme contrast measurements
|
||||
|
||||
Measured contrast ratios for the theme token contract, in the light theme and in the dark theme. Every number in the table below was produced by the harness in this repository, not estimated by hand.
|
||||
|
||||
- **Harness:** `scripts/check-contrast.mjs`
|
||||
- **Pair list:** `scripts/contrast-pairs.json`
|
||||
- **Token source:** `public/src/main.css` (`:root` block for light, `.dark` block for dark)
|
||||
- **Measured at:** the token values of commit `552d8474bf68e3fe37950fb7a97196daf33f84c0`, 2026-11-02. The token file is unchanged between that commit and this one (`git diff 552d847 HEAD -- public/src/main.css public/tailwind.config.js` is empty), so the table still holds at the branch head.
|
||||
- **Result:** 16 pairs measured in 2 themes = 32 measurements, 32 pass, 0 fail
|
||||
|
||||
Reproduce with:
|
||||
|
||||
```
|
||||
node scripts/check-contrast.mjs
|
||||
```
|
||||
|
||||
The harness exits `0` when every pair meets its threshold, `1` when at least one pair is below its threshold (naming each failing pair with its token names, values, measured ratio and required threshold), and `2` on a usage or I/O error.
|
||||
|
||||
## Which stylesheet holds the tokens
|
||||
|
||||
Two stylesheets are imported by `public/src/main.js`. The contrast is measured against the one the browser actually receives.
|
||||
|
||||
- `public/src/assets/styles/main.css` is the legacy Tailwind stylesheet. It contains no `:root` block, no `.dark` block and no `--color-*` declaration, so it holds no theme token values.
|
||||
- `public/src/main.css` is the token stylesheet. It holds the only `:root` block and the only `.dark` block, with the nine semantic colour tokens.
|
||||
|
||||
The built bundle confirms this. After `npm run build` in `public/`, the token blocks are the last rules of the built stylesheet `public/dist/assets/index-WwvGP2s-.css`, and `public/dist/index.html` links that file. The hashed file name is the one from the build at the measured commit, so it changes if the stylesheet changes:
|
||||
|
||||
```
|
||||
$ grep -cE '(^|[^-\w])\:root\s*\{' public/src/assets/styles/main.css
|
||||
0
|
||||
$ grep -cE '\.dark\s*\{' public/src/assets/styles/main.css
|
||||
0
|
||||
$ grep -c -- '--color-' public/src/assets/styles/main.css
|
||||
0
|
||||
$ grep -cE '(^|[^-\w])\:root\s*\{' public/src/main.css
|
||||
1
|
||||
$ grep -cE '\.dark\s*\{' public/src/main.css
|
||||
1
|
||||
$ grep -c -- '--color-' public/src/main.css
|
||||
27
|
||||
$ grep -oE 'href="\./assets/index-[^"]*\.css"' public/dist/index.html
|
||||
href="./assets/index-WwvGP2s-.css"
|
||||
$ tail -c 400 public/dist/assets/index-WwvGP2s-.css
|
||||
...d-foreground:#475569;--color-border:#64748b;--color-accent:#1d4ed8;--color-accent-foreground:#fff;--color-text-body:#374151;--color-text-large:#1f2937}.dark{--color-background:#0f172a;--color-foreground:#f8fafc;--color-muted:#1e293b;--color-muted-foreground:#94a3b8;--color-border:#7c8ca3;--color-accent:#60a5fa;--color-accent-foreground:#0f172a;--color-text-body:#cbd5e1;--color-text-large:#e2e8f0}
|
||||
```
|
||||
|
||||
The start of the tail is elided with `...`; the token blocks are the two rules at the end of the file.
|
||||
|
||||
Running the harness against the built bundle gives the same ratios as the table below, which confirms the token file is what the browser sees:
|
||||
|
||||
```
|
||||
$ node scripts/check-contrast.mjs --tokens public/dist/assets/index-WwvGP2s-.css --json
|
||||
... "pairs": 16, "failures": 0 ...
|
||||
```
|
||||
|
||||
## Thresholds
|
||||
|
||||
The threshold for each pair comes from its own `threshold` field in `scripts/contrast-pairs.json`, and the harness checks it against the category default, so a threshold that disagrees with its category is rejected:
|
||||
|
||||
- `body-text` — 4.5:1 (WCAG 2.2 SC 1.4.3 Contrast Minimum).
|
||||
- `large-text` — 3:1 (WCAG 2.2 SC 1.4.3, large-scale text).
|
||||
- `ui-component` — 3:1 (WCAG 2.2 SC 1.4.11 Non-text Contrast, for component boundaries such as borders and focus outlines).
|
||||
|
||||
## Measured table
|
||||
|
||||
Ratios are computed with the WCAG 2.2 relative-luminance formula, `(L1 + 0.05) / (L2 + 0.05)`, and rounded to two decimals for display. The harness compares the unrounded ratio against the threshold.
|
||||
|
||||
| Pair | Category | Light foreground | Light background | Light ratio | Dark foreground | Dark background | Dark ratio | Threshold | Result |
|
||||
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||
| `body-text-on-background` | body-text | `--color-text-body` #374151 | `--color-background` #ffffff | 10.31:1 | `--color-text-body` #cbd5e1 | `--color-background` #0f172a | 12.02:1 | 4.5:1 | pass |
|
||||
| `body-text-on-muted` | body-text | `--color-text-body` #374151 | `--color-muted` #f1f5f9 | 9.41:1 | `--color-text-body` #cbd5e1 | `--color-muted` #1e293b | 9.85:1 | 4.5:1 | pass |
|
||||
| `foreground-on-background` | body-text | `--color-foreground` #111827 | `--color-background` #ffffff | 17.74:1 | `--color-foreground` #f8fafc | `--color-background` #0f172a | 17.06:1 | 4.5:1 | pass |
|
||||
| `foreground-on-muted` | body-text | `--color-foreground` #111827 | `--color-muted` #f1f5f9 | 16.19:1 | `--color-foreground` #f8fafc | `--color-muted` #1e293b | 13.98:1 | 4.5:1 | pass |
|
||||
| `muted-foreground-on-background` | body-text | `--color-muted-foreground` #475569 | `--color-background` #ffffff | 7.58:1 | `--color-muted-foreground` #94a3b8 | `--color-background` #0f172a | 6.96:1 | 4.5:1 | pass |
|
||||
| `muted-foreground-on-muted` | body-text | `--color-muted-foreground` #475569 | `--color-muted` #f1f5f9 | 6.92:1 | `--color-muted-foreground` #94a3b8 | `--color-muted` #1e293b | 5.71:1 | 4.5:1 | pass |
|
||||
| `accent-text-on-background` | body-text | `--color-accent` #1d4ed8 | `--color-background` #ffffff | 6.70:1 | `--color-accent` #60a5fa | `--color-background` #0f172a | 7.02:1 | 4.5:1 | pass |
|
||||
| `accent-text-on-muted` | body-text | `--color-accent` #1d4ed8 | `--color-muted` #f1f5f9 | 6.12:1 | `--color-accent` #60a5fa | `--color-muted` #1e293b | 5.75:1 | 4.5:1 | pass |
|
||||
| `accent-foreground-on-accent` | body-text | `--color-accent-foreground` #ffffff | `--color-accent` #1d4ed8 | 6.70:1 | `--color-accent-foreground` #0f172a | `--color-accent` #60a5fa | 7.02:1 | 4.5:1 | pass |
|
||||
| `large-text-on-background` | large-text | `--color-text-large` #1f2937 | `--color-background` #ffffff | 14.68:1 | `--color-text-large` #e2e8f0 | `--color-background` #0f172a | 14.48:1 | 3.0:1 | pass |
|
||||
| `large-text-on-muted` | large-text | `--color-text-large` #1f2937 | `--color-muted` #f1f5f9 | 13.40:1 | `--color-text-large` #e2e8f0 | `--color-muted` #1e293b | 11.87:1 | 3.0:1 | pass |
|
||||
| `border-on-background` | ui-component | `--color-border` #64748b | `--color-background` #ffffff | 4.76:1 | `--color-border` #7c8ca3 | `--color-background` #0f172a | 5.22:1 | 3.0:1 | pass |
|
||||
| `border-on-muted` | ui-component | `--color-border` #64748b | `--color-muted` #f1f5f9 | 4.34:1 | `--color-border` #7c8ca3 | `--color-muted` #1e293b | 4.28:1 | 3.0:1 | pass |
|
||||
| `accent-boundary-on-background` | ui-component | `--color-accent` #1d4ed8 | `--color-background` #ffffff | 6.70:1 | `--color-accent` #60a5fa | `--color-background` #0f172a | 7.02:1 | 3.0:1 | pass |
|
||||
| `accent-boundary-on-muted` | ui-component | `--color-accent` #1d4ed8 | `--color-muted` #f1f5f9 | 6.12:1 | `--color-accent` #60a5fa | `--color-muted` #1e293b | 5.75:1 | 3.0:1 | pass |
|
||||
| `foreground-boundary-on-background` | ui-component | `--color-foreground` #111827 | `--color-background` #ffffff | 17.74:1 | `--color-foreground` #f8fafc | `--color-background` #0f172a | 17.06:1 | 3.0:1 | pass |
|
||||
|
||||
No pair is below its threshold in either theme, so there are no failing pairs to report at this commit.
|
||||
|
||||
## Full harness output at this commit
|
||||
|
||||
```
|
||||
$ node scripts/check-contrast.mjs
|
||||
check-contrast: token file public/src/main.css
|
||||
check-contrast: pair list scripts/contrast-pairs.json
|
||||
check-contrast: 16 pair(s) measured in 2 theme(s)
|
||||
|
||||
theme: light
|
||||
pass body-text-on-background (--color-text-body #374151 on --color-background #ffffff) ratio 10.31:1, required 4.5:1
|
||||
pass body-text-on-muted (--color-text-body #374151 on --color-muted #f1f5f9) ratio 9.41:1, required 4.5:1
|
||||
pass foreground-on-background (--color-foreground #111827 on --color-background #ffffff) ratio 17.74:1, required 4.5:1
|
||||
pass foreground-on-muted (--color-foreground #111827 on --color-muted #f1f5f9) ratio 16.19:1, required 4.5:1
|
||||
pass muted-foreground-on-background (--color-muted-foreground #475569 on --color-background #ffffff) ratio 7.58:1, required 4.5:1
|
||||
pass muted-foreground-on-muted (--color-muted-foreground #475569 on --color-muted #f1f5f9) ratio 6.92:1, required 4.5:1
|
||||
pass accent-text-on-background (--color-accent #1d4ed8 on --color-background #ffffff) ratio 6.70:1, required 4.5:1
|
||||
pass accent-text-on-muted (--color-accent #1d4ed8 on --color-muted #f1f5f9) ratio 6.12:1, required 4.5:1
|
||||
pass accent-foreground-on-accent (--color-accent-foreground #ffffff on --color-accent #1d4ed8) ratio 6.70:1, required 4.5:1
|
||||
pass large-text-on-background (--color-text-large #1f2937 on --color-background #ffffff) ratio 14.68:1, required 3.0:1
|
||||
pass large-text-on-muted (--color-text-large #1f2937 on --color-muted #f1f5f9) ratio 13.40:1, required 3.0:1
|
||||
pass border-on-background (--color-border #64748b on --color-background #ffffff) ratio 4.76:1, required 3.0:1
|
||||
pass border-on-muted (--color-border #64748b on --color-muted #f1f5f9) ratio 4.34:1, required 3.0:1
|
||||
pass accent-boundary-on-background (--color-accent #1d4ed8 on --color-background #ffffff) ratio 6.70:1, required 3.0:1
|
||||
pass accent-boundary-on-muted (--color-accent #1d4ed8 on --color-muted #f1f5f9) ratio 6.12:1, required 3.0:1
|
||||
pass foreground-boundary-on-background (--color-foreground #111827 on --color-background #ffffff) ratio 17.74:1, required 3.0:1
|
||||
|
||||
theme: dark
|
||||
pass body-text-on-background (--color-text-body #cbd5e1 on --color-background #0f172a) ratio 12.02:1, required 4.5:1
|
||||
pass body-text-on-muted (--color-text-body #cbd5e1 on --color-muted #1e293b) ratio 9.85:1, required 4.5:1
|
||||
pass foreground-on-background (--color-foreground #f8fafc on --color-background #0f172a) ratio 17.06:1, required 4.5:1
|
||||
pass foreground-on-muted (--color-foreground #f8fafc on --color-muted #1e293b) ratio 13.98:1, required 4.5:1
|
||||
pass muted-foreground-on-background (--color-muted-foreground #94a3b8 on --color-background #0f172a) ratio 6.96:1, required 4.5:1
|
||||
pass muted-foreground-on-muted (--color-muted-foreground #94a3b8 on --color-muted #1e293b) ratio 5.71:1, required 4.5:1
|
||||
pass accent-text-on-background (--color-accent #60a5fa on --color-background #0f172a) ratio 7.02:1, required 4.5:1
|
||||
pass accent-text-on-muted (--color-accent #60a5fa on --color-muted #1e293b) ratio 5.75:1, required 4.5:1
|
||||
pass accent-foreground-on-accent (--color-accent-foreground #0f172a on --color-accent #60a5fa) ratio 7.02:1, required 4.5:1
|
||||
pass large-text-on-background (--color-text-large #e2e8f0 on --color-background #0f172a) ratio 14.48:1, required 3.0:1
|
||||
pass large-text-on-muted (--color-text-large #e2e8f0 on --color-muted #1e293b) ratio 11.87:1, required 3.0:1
|
||||
pass border-on-background (--color-border #7c8ca3 on --color-background #0f172a) ratio 5.22:1, required 3.0:1
|
||||
pass border-on-muted (--color-border #7c8ca3 on --color-muted #1e293b) ratio 4.28:1, required 3.0:1
|
||||
pass accent-boundary-on-background (--color-accent #60a5fa on --color-background #0f172a) ratio 7.02:1, required 3.0:1
|
||||
pass accent-boundary-on-muted (--color-accent #60a5fa on --color-muted #1e293b) ratio 5.75:1, required 3.0:1
|
||||
pass foreground-boundary-on-background (--color-foreground #f8fafc on --color-background #0f172a) ratio 17.06:1, required 3.0:1
|
||||
|
||||
check-contrast: 16 pair(s), 32 measurement(s), 32 pass, 0 fail
|
||||
$ echo $?
|
||||
0
|
||||
```
|
||||
|
||||
## Harness self-test
|
||||
|
||||
The harness was checked against fixtures that break the token contract on purpose, to confirm it fails loudly instead of passing silently. The fixtures are scratch copies of the token file; the token file in the repository is unchanged.
|
||||
|
||||
One foreground changed so that exactly one pair fails — light `--color-accent-foreground` moved from `#ffffff` to `#93c5fd`:
|
||||
|
||||
```
|
||||
$ diff public/src/main.css "$LOCUST_SCRATCH_DIR/fixture-single-pair.css"
|
||||
35c35
|
||||
< --color-accent-foreground: #ffffff;
|
||||
---
|
||||
> --color-accent-foreground: #93c5fd;
|
||||
$ node scripts/check-contrast.mjs --tokens "$LOCUST_SCRATCH_DIR/fixture-single-pair.css"
|
||||
...
|
||||
check-contrast: 16 pair(s), 32 measurement(s), 31 pass, 1 fail
|
||||
|
||||
failing pairs:
|
||||
accent-foreground-on-accent [light] --color-accent-foreground #93c5fd on --color-accent #1d4ed8: ratio 3.72:1, required 4.5:1 - contrast ratio below the required threshold
|
||||
$ echo $?
|
||||
1
|
||||
```
|
||||
|
||||
One foreground changed so that several pairs fail — light `--color-text-body` moved from `#374151` to `#9ca3af`:
|
||||
|
||||
```
|
||||
$ node scripts/check-contrast.mjs --tokens "$LOCUST_SCRATCH_DIR/fixture-failing-tokens.css"
|
||||
...
|
||||
check-contrast: 16 pair(s), 32 measurement(s), 30 pass, 2 fail
|
||||
|
||||
failing pairs:
|
||||
body-text-on-background [light] --color-text-body #9ca3af on --color-background #ffffff: ratio 2.54:1, required 4.5:1 - contrast ratio below the required threshold
|
||||
body-text-on-muted [light] --color-text-body #9ca3af on --color-muted #f1f5f9: ratio 2.32:1, required 4.5:1 - contrast ratio below the required threshold
|
||||
$ echo $?
|
||||
1
|
||||
```
|
||||
|
||||
A token removed from the dark theme is reported as a failure, not skipped:
|
||||
|
||||
```
|
||||
$ node scripts/check-contrast.mjs --tokens "$LOCUST_SCRATCH_DIR/fixture-missing-token.css"
|
||||
...
|
||||
check-contrast: 16 pair(s), 32 measurement(s), 30 pass, 2 fail
|
||||
|
||||
failing pairs:
|
||||
border-on-background [dark] --color-border n/a on --color-background #0f172a: ratio n/a, required 3.0:1 - token not defined in the dark theme: --color-border
|
||||
border-on-muted [dark] --color-border n/a on --color-muted #1e293b: ratio n/a, required 3.0:1 - token not defined in the dark theme: --color-border
|
||||
$ echo $?
|
||||
1
|
||||
```
|
||||
|
||||
A bad invocation exits `2` rather than reporting a pass:
|
||||
|
||||
```
|
||||
$ node scripts/check-contrast.mjs --tokens /nonexistent.css
|
||||
check-contrast: cannot read token file: /nonexistent.css
|
||||
Usage: node scripts/check-contrast.mjs [options]
|
||||
...
|
||||
$ echo $?
|
||||
2
|
||||
```
|
||||
|
||||
A pair whose threshold disagrees with its category is rejected instead of being measured against a threshold the reviewer did not write:
|
||||
|
||||
```
|
||||
$ node scripts/check-contrast.mjs --pairs "$LOCUST_SCRATCH_DIR/pairs-bad-threshold.json"
|
||||
check-contrast: pair "body-text-on-background" has threshold 3, but category "body-text" requires 4.5
|
||||
Usage: node scripts/check-contrast.mjs [options]
|
||||
...
|
||||
$ echo $?
|
||||
2
|
||||
```
|
||||
|
||||
## Scope
|
||||
|
||||
This harness measures the token contract: the values declared in `public/src/main.css` and the pairs listed in `scripts/contrast-pairs.json`. It does not audit how the components consume the tokens. At this commit the components still use the legacy hard-coded Tailwind palette classes (`text-gray-100`, `bg-gray-900`, `text-blue-600` and similar), so no component references the new token utilities yet; adopting them is the work of the redesign card. When a component adopts a token, the pair that governs that surface must exist in `scripts/contrast-pairs.json`.
|
||||
|
||||
The pair list is data, not code, so adding a governed surface is a one-line JSON change. The harness rejects a pair with an unknown category, a missing field or a duplicate id, so a malformed list fails loudly instead of silently measuring less than intended.
|
||||
@@ -0,0 +1,797 @@
|
||||
# BEAT weak-point record
|
||||
|
||||
Inventory of every weak point found in `README.md` and in the site content (`public/src/data`, `public/src/views`), written before any repair, and reconciled with the repairs actually made at the branch head. Nothing in this file is fixed text; each entry states the resolution that was made — the file and section that now carries the corrected wording, the deviation from the resolution planned at audit time, and the disposition of every claim or figure that was reworded as opinion or removed.
|
||||
|
||||
## Reconciliation
|
||||
|
||||
- **Entry count:** 52 entries, unchanged — WP-01 to WP-52.
|
||||
- **Category counts:** unchanged — 10 unsupported claim, 8 wrong number, 15 self-contradiction, 14 rule not applicable as written, 5 uncovered situation.
|
||||
- **Reconciled against:** the branch head `de96a46`, reading `README.md` (`36d4223`), `public/src/data` (`588fb8d`, `ec83e8e`, `349af72`), `public/src/views` (`b11d9ff`, `fa782d0`, `2bc9527`) as they stand.
|
||||
- **What changed per entry:** the `Planned resolution` line of the audit is replaced by `Resolution made`, which names the file and section or data key that now carries the fixed text. `Deviation from plan` is present only where the repair landed somewhere other than the plan said. `Disposition` states what happened to the claim or figure — reworded, removed or added — and quotes the new wording. `Resolved position` is present on every self-contradiction entry.
|
||||
- **Left as the audit wrote them:** the "Uncited claims and figures" list and the "Planned resolutions summary" table at the end of this file are kept unchanged, so the audit trail stays readable. Where an entry shows that a listed claim or a planned location no longer matches the text at the branch head, the entry says so; the list and the table were not edited to match. One list line has gained a pointer to the entry that settles it: the `PracticesView.vue` — "Multi-Maker Work" bullet now names WP-47, because those cards were removed from the view by the repairs.
|
||||
- **Not reconciled here:** this record does not own the files that carry the two wording differences it named — the self-assessment band arithmetic (WP-18, WP-51) and the "one working day" / "24 working hours" wording (WP-31, WP-41). Both were left open by this record and closed later by the cards named in the "Closed since" bullets below; no wording difference between `README.md` and the site data is open at the branch head.
|
||||
- **Closed since:** the "one working day" / "24 working hours" wording difference (WP-31, WP-41) was closed by card `77cc3e22`: `README.md` now reads "24 working hours" in Principle 6, in "Prioritization" and in "Avoiding Chokepoints" → "Decisions", and the "Working across Time Zones" lead-in now reads "Every rule in BEAT that counts time runs on the team's stated coverage hours, in working hours."
|
||||
- **Closed since:** the self-assessment band arithmetic (WP-18, WP-51) was closed by card `776499a9`: `README.md` — "The Self-Assessment" now reads "The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, and high 43 to 48.", the position `public/src/data/assessment.js` — `overallAssessment.scoring` already carried.
|
||||
|
||||
## How to read this record
|
||||
|
||||
Each entry gives:
|
||||
|
||||
- **Location** — file and section (or data key / view component) where the weak point sits.
|
||||
- **Category** — one of: unsupported claim, wrong number, self-contradiction, uncovered situation, rule not applicable as written.
|
||||
- **Original wording** — quoted verbatim from the file.
|
||||
- **Resolution made** — the file and section that now carries the fixed text, as it reads at the branch head.
|
||||
- **Deviation from plan** — where the repair landed somewhere other than the planned resolution said. Present only where it applies.
|
||||
- **Disposition** — what happened to the claim or figure: reworded, removed or added, with the new wording quoted.
|
||||
- **Resolved position** — the position the text now takes. Present on every self-contradiction entry.
|
||||
|
||||
Every claim and figure in scope was settled from the text itself, so each entry names the resolution that was made rather than an open question. No difference between `README.md` and the site data is still open at the branch head. The wording difference named in WP-31 and WP-41 was closed later by card `77cc3e22`, and the band-derivation difference named in WP-18 and WP-51 was closed later by card `776499a9`.
|
||||
|
||||
Categories are ordered: unsupported claim, wrong number, self-contradiction, rule not applicable as written, uncovered situation. The uncited-claims list is at the end, one line per claim or figure, including the claims expected to be reworded or removed.
|
||||
|
||||
---
|
||||
|
||||
## Unsupported claim
|
||||
|
||||
### WP-01 — The whole "research" list has no source
|
||||
|
||||
- **Location:** `README.md` — "What We Have Learned"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "BEAT emerges from research on how developers actually work:"
|
||||
- **Resolution made:** `README.md` — "What We Have Learned" now opens "Some of what follows comes from published work, with the source named. The rest is what we have seen in the teams that run BEAT — our own observations, not research findings." Each surviving claim carries a named source; mirrored in `public/src/data/manifesto.js` — `researchStats`, which now holds five entries (25 minutes [mark-2005], 52 minutes [desktime-2014], 3h 43m [desktime-2014], 71% [rogelberg-2019], 73% [mit-sloan-2017]).
|
||||
- **Disposition:** reworded — the list is no longer framed as research: "Some of what follows comes from published work, with the source named. The rest is what we have seen in the teams that run BEAT — our own observations, not research findings." The site copy was reworded in the same pass: `public/src/views/HomeView.vue` — the hero prose "A software delivery methodology built for how developers actually work." and the "Our Philosophy" section, whose sentence "BEAT emerges from research on how developers actually work. We built it for these realities, not against them." framed the research list as research, were reworded — the hero now carries the computed summary "The method states ${coreValues.length} core values and ${principleCount} principles. This site reads it in ${orderedSections.length} sections, in reading order." and the page renders "What we value more", "What the research says", "The BEAT Commitment" and "Where to go next"; the `keyNumbers` cards "4hrs" and "2hrs" were removed from the page.
|
||||
|
||||
### WP-02 — Developer introversion stated as fact
|
||||
|
||||
- **Location:** `README.md` — "What We Have Learned"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "Developers trend toward introversion and need low-stimulation focus time"
|
||||
- **Resolution made:** `README.md` — "What We Have Learned": the personality claim is replaced by an observation the authors can stand behind, "developers we work with ask for long stretches of low-stimulation time", inside the paragraph that separates published work from BEAT's own observations. Not mirrored on the site, as planned.
|
||||
- **Disposition:** reworded — "developers we work with ask for long stretches of low-stimulation time" (the previous "Developers trend toward introversion and need low-stimulation focus time" is gone).
|
||||
|
||||
### WP-03 — Self-determination theory presented as unnamed research
|
||||
|
||||
- **Location:** `README.md` — "What We Have Learned"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "Autonomy, competence, and relatedness drive intrinsic motivation"
|
||||
- **Resolution made:** `README.md` — Principle 7 now attributes the theory: "We give makers autonomy because autonomy, competence and relatedness are the needs that make sustained motivation possible [deci-ryan-2000] — a general motivation finding, not a result about developers." The source is listed under `README.md` — "References" with id `deci-ryan-2000`.
|
||||
- **Disposition:** reworded — "autonomy, competence and relatedness are the needs that make sustained motivation possible [deci-ryan-2000] — a general motivation finding, not a result about developers."
|
||||
|
||||
### WP-04 — "Research shows" with no citation, twice
|
||||
|
||||
- **Location:** `README.md` — Principle 2, "Interruptions are not free"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "Research shows 52 minutes to reach deep focus, 23 minutes to recover from interruption."
|
||||
- **Resolution made:** `README.md` — Principle 2 now reads "Resuming interrupted work takes about twenty-five minutes [mark-2005], and the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014]."; mirrored in `public/src/data/manifesto.js` — `principles.focus[1].description` and `researchStats`, and in `public/src/data/assessment.js` — `beatRecommendations.focus.low.description`.
|
||||
- **Disposition:** reworded — "Resuming interrupted work takes about twenty-five minutes [mark-2005], and the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014]." The closing sentence of the same paragraph, "Every \"quick question\" costs more than it appears.", was reworded in `README.md` — Principle 2 and in `public/src/data/manifesto.js` — `principles.focus[1].description`: the paragraph now opens "Interrupting someone costs more than the question appears to." and ends with "So we default to async and wait for the open window." In plain text the removed sentence was: Every "quick question" costs more than it appears.
|
||||
|
||||
### WP-05 — The nine limits are presented as if derived from research
|
||||
|
||||
- **Location:** `README.md` — "Appendix: Quick Reference" → "The Numbers"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "| Sacred block | 4 hours daily |", "| Meetings per week | ≤2 hours total |", "| WIP per maker | 3 items |", "| Planning capacity | 80% |", "| Exploration time | 20% (1 day/beat) |", "| NOW items | Max 3-5 |", "| Review response | 4 hours |", "| Auto-proceed | 24 hours |"
|
||||
- **Resolution made:** `README.md` — "Appendix: Quick Reference" → "The Numbers" now opens "Every limit below is a BEAT default chosen by the BEAT authors. None of them is a research finding"; mirrored in `public/src/data/manifesto.js` — `constraints`, which carries the same sentence above its nine rows.
|
||||
- **Deviation from plan:** the planned view sections `public/src/views/FrameworkView.vue` — "The Numbers" and `public/src/views/ReferenceView.vue` — "The Numbers" do not exist at the branch head. The view mirror is now `FrameworkView.vue` — "Planning numbers" and `ReferenceView.vue` — "Constraints", and the source-of-truth sentence lives in `README.md` and in `manifesto.js` — `constraints`.
|
||||
- **Disposition:** reworded — "Every limit below is a BEAT default chosen by the BEAT authors. None of them is a research finding". The limits were reworded where they were stated as findings: `README.md` — "Daily Check-in" now reads "Post once daily, when convenient, in your own working day. Two minutes. No gathering required." instead of "Post once daily, when convenient. Two minutes."; `public/src/data/manifesto.js` — `ceremonies` now reads "Creative solving, with a 10-minute exit window — a BEAT default, not a research finding" instead of "Creative solving, with 10-minute exit window"; `public/src/views/PracticesView.vue` no longer renders the "Daily Check-in" section or the `keyNumbers` cards "2 hours" / "per week total" and "1 hour" / "maximum per meeting", so those two figures now appear only as BEAT defaults under the constraints table.
|
||||
|
||||
### WP-06 — Suitability claims with no evidence
|
||||
|
||||
- **Location:** `README.md` — "Where BEAT Fits"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "BEAT works best for:", "Remote-first or distributed teams", "Senior and mid-level developers", "Product companies", "Teams of 3-8 people", "High-trust environments", "Async-native cultures", "BEAT fits poorly for:", "Junior-heavy teams needing close guidance", "Regulated industries requiring ceremony", "Agency work with constant client sync", "Organizations unwilling to protect focus time", "BEAT can adapt for:"
|
||||
- **Resolution made:** `README.md` — "Where BEAT Fits" now opens "These are the contexts we have seen BEAT used in, not a researched fit. The list records our practice; it is not a finding about what improves delivery." and its three lists are headed "BEAT has worked for us in:", "BEAT has fitted poorly in:" and "BEAT has been adapted for:"; mirrored in `public/src/data/manifesto.js` — `whereItFits` (the same note is carried in `whereItFits.note`), rendered by `public/src/views/AntiPatternsView.vue` — "Where BEAT fits".
|
||||
- **Disposition:** reworded — "These are the contexts we have seen BEAT used in, not a researched fit." The list labels "BEAT works best for:", "BEAT fits poorly for:" and "BEAT can adapt for:" were replaced by the three "has worked / has fitted poorly / has been adapted" headings. The same pass removed the site-only `public/src/views/ValuesView.vue` — "Values in Action" section, whose sentence "These values are not just words on a page. They guide our daily decisions, how we interact with each other, and how we approach every piece of work. When in doubt, return to these values." claimed an effect the values cannot have; the page now renders "Core values" and "Team values", each stating the behaviour it requires.
|
||||
|
||||
### WP-07 — "Burnout destroys teams" stated as fact
|
||||
|
||||
- **Location:** `README.md` — Principle 10, "Sustainable pace is not optional"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "Burnout destroys teams. Recovery is productive."
|
||||
- **Resolution made:** `README.md` — Principle 10 now states the BEAT stance, "Overtime is a red flag, not a badge of honor. When deadlines conflict with capacity, we cut scope and we never cut rest."; mirrored in `public/src/data/manifesto.js` — `principles.sustainability[0].description`, and in `README.md` — "Burnout Prevention" → "**Plan at 80%.**".
|
||||
- **Disposition:** removed — "Burnout destroys teams. Recovery is productive." was removed and replaced by "Overtime is a red flag, not a badge of honor. When deadlines conflict with capacity, we cut scope and we never cut rest."
|
||||
|
||||
### WP-08 — "Building in isolation produces irrelevant software"
|
||||
|
||||
- **Location:** `README.md` — "Customer & User Feedback"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "Building in isolation produces irrelevant software. We stay connected to users:"
|
||||
- **Resolution made:** `README.md` — "Customer & User Feedback" now opens "Work built away from users drifts away from what users need. We keep the line to users open." and closes with "**What this is not.** This is a practice the team commits to, not a researched effect on delivery." The section now has a site counterpart — `public/src/data/manifesto.js` — `customerFeedback` (see WP-50).
|
||||
- **Disposition:** reworded — "Work built away from users drifts away from what users need. We keep the line to users open."
|
||||
|
||||
### WP-09 — "The uninterrupted mind produces the best work"
|
||||
|
||||
- **Location:** `README.md` — Principle 1, "Protect the focus state above all else"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "The uninterrupted mind produces the best work."
|
||||
- **Resolution made:** `README.md` — Principle 1 now reads "Sacred blocks come first, because everything else in the plan depends on them. A maker protects a focus block of four hours each working day — a BEAT default, listed in the constraints table — and chooses when it falls."; mirrored in `public/src/data/manifesto.js` — `principles.focus[0].description`, and in `public/src/data/assessment.js` — `beatRecommendations.focus.low.beatPrinciple`, which no longer carries the claim.
|
||||
- **Disposition:** removed — "The uninterrupted mind produces the best work." was removed; the principle now carries the BEAT stance quoted above with the four-hour block marked as a BEAT default.
|
||||
|
||||
### WP-10 — Quantitative comparison of focus versus meetings
|
||||
|
||||
- **Location:** `README.md` — Principle 3, "Presence does not equal productivity"
|
||||
- **Category:** unsupported claim
|
||||
- **Original wording:** "A maker in focus for four hours outproduces a maker in meetings for eight."
|
||||
- **Resolution made:** `README.md` — Principle 3 now reads "We do not measure hours worked or time online. We measure outcomes delivered. Presence is not evidence of output, so a maker is judged by what ships, not by hours spent in meetings."; mirrored in `public/src/data/manifesto.js` — `principles.focus[2].description`, and in `public/src/data/assessment.js` — `beatRecommendations.focus.medium`, whose `description` is now "You have some focus time, but it's inconsistent. With more structure, your team could recover time that interruptions now take from it."
|
||||
- **Disposition:** removed — "A maker in focus for four hours outproduces a maker in meetings for eight." was removed; no hours-versus-hours comparison remains. The same wording in `public/src/data/assessment.js` — `beatRecommendations.focus.medium.description` was reworded: "With more structure, your team could recover time that interruptions now take from it." replaces "With more structure, your team could dramatically increase productivity."
|
||||
|
||||
---
|
||||
|
||||
## Wrong number
|
||||
|
||||
### WP-11 — "52 minutes to reach deep focus" is a different finding
|
||||
|
||||
- **Location:** `README.md` — Principle 2 and "What We Have Learned"
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "Research shows 52 minutes to reach deep focus, 23 minutes to recover from interruption." and "Deep focus requires 52 minutes to reach and 23 minutes to recover from interruption"
|
||||
- **Why:** The 52-minute figure comes from DeskTime's 2014 analysis of its own users: the most productive 10% worked in 52-minute blocks followed by 17-minute breaks. It is the length of a productive work block, not the time it takes to reach focus.
|
||||
- **Resolution made:** `README.md` — Principle 2 and "What We Have Learned" now state the finding as measured, "the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014]"; mirrored in `public/src/data/manifesto.js` — `researchStats` and `principles.focus[1].description`, and in `public/src/data/assessment.js` — `beatRecommendations.focus.low.description`.
|
||||
- **Disposition:** reworded — "the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014]" (the figure is now the length of a productive block, not the time to reach focus). The same claim in `public/src/data/assessment.js` — `beatRecommendations.focus.low.description` was reworded: "Constant interruptions and meetings are undermining your team's ability to do deep work. Resuming interrupted work takes about twenty-five minutes [mark-2005], and the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014]." — the sentence "Research shows it takes 52 minutes to reach focus and 23 minutes to recover from interruption." is gone.
|
||||
|
||||
### WP-12 — "23 minutes to recover" carries false precision
|
||||
|
||||
- **Location:** `README.md` — Principle 2 and "What We Have Learned"
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "23 minutes to recover from interruption"
|
||||
- **Why:** The 23 minutes 15 seconds figure was given to the 2006 Gallup Business Journal in an interview; the peer-reviewed CHI 2005 paper ("No Task Left Behind?", Mark, González and Harris) reports 25 minutes 26 seconds for the same measure. The seconds-level precision is not from a published paper.
|
||||
- **Resolution made:** `README.md` — Principle 2 now gives the peer-reviewed figure, "Resuming interrupted work takes about twenty-five minutes [mark-2005]"; mirrored in `public/src/data/manifesto.js` — `researchStats` and `principles.focus[1].description`, and in `public/src/data/assessment.js` — `beatRecommendations.focus.low.description`.
|
||||
- **Disposition:** reworded — "Resuming interrupted work takes about twenty-five minutes [mark-2005]". The 23 minutes 15 seconds figure and its seconds-level precision were dropped.
|
||||
|
||||
### WP-13 — "More than two meetings per day reduces productive output to 14%" has no source
|
||||
|
||||
- **Location:** `README.md` — "What We Have Learned"
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "More than two meetings per day reduces productive output to 14%"
|
||||
- **Why:** No published finding supports this. The closest real results are Slack's Workplace Lab survey (more than two *hours* a day in meetings hurts productivity, with no 14% figure), MIT Sloan's meeting-free-day study across 76 companies (up to 73% productivity gain, 57% less stress), and a Stack Overflow survey of developers (they want to decline 31% of meetings but cancel only 14% — a different quantity that reads like the source of this number).
|
||||
- **Resolution made:** `README.md` — "What We Have Learned": the 14% claim was removed and replaced by the sourced meeting-free-day finding, cited to `mit-sloan-2017`; mirrored in `public/src/data/manifesto.js` — `researchStats`, which carries 73% [mit-sloan-2017] and no 14% entry.
|
||||
- **Disposition:** removed — "More than two meetings per day reduces productive output to 14%" was removed; the replacement is the MIT Sloan meeting-free-day finding, 73% [mit-sloan-2017], stated as what that study measured. The same figure in `public/src/data/manifesto.js` — `researchStats[2]`, "14%" / "productive output with 2+ meetings/day", was removed with the claim it belonged to; `researchStats` now holds 25 minutes [mark-2005], 52 minutes [desktime-2014], 3h 43m [desktime-2014], 71% [rogelberg-2019] and 73% [mit-sloan-2017]. The unsourced share in `public/src/data/assessment.js` — `beatRecommendations.focus.medium.recommendations[1]`, "Audit your meeting calendar - can 50% become async?", was reworded to "Audit your meeting calendar - can half of it become async?".
|
||||
|
||||
### WP-14 — "Peak cognitive work capacity is approximately four hours per day" rounds a different number
|
||||
|
||||
- **Location:** `README.md` — "What We Have Learned"
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "Peak cognitive work capacity is approximately four hours per day"
|
||||
- **Why:** The nearest published figure is DeskTime's ~3 hours 43 minutes of focused work per day for top performers; Slack's survey found that people would *like* four hours of focus time, which is a preference, not a capacity limit. The stated figure reads as a research finding.
|
||||
- **Resolution made:** `README.md` — "What We Have Learned": the four-hour capacity claim was replaced by the DeskTime figure of 3h 43m of focused work per day for top performers, cited to `desktime-2014`; mirrored in `public/src/data/manifesto.js` — `researchStats`, which carries 3h 43m [desktime-2014].
|
||||
- **Disposition:** reworded — the "approximately four hours per day" capacity claim is gone; the four-hour block survives only as a BEAT default, "a BEAT default, listed in the constraints table" (Principle 1, `constraints`). The same figure in `public/src/data/manifesto.js` — `researchStats[3]`, "4 hours" / "peak cognitive work capacity daily", was reworded to "3h 43m" / "focused work per day for the top performers tracked [desktime-2014]".
|
||||
|
||||
### WP-15 — "72% of meetings are ineffective at their stated purpose"
|
||||
|
||||
- **Location:** `README.md` — "What We Have Learned"
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "72% of meetings are ineffective at their stated purpose"
|
||||
- **Why:** The citable figures are 71% (182 senior managers surveyed in a Harvard Business School study, reported by Rogelberg, *The Surprising Science of Meetings*, OUP 2019) and 70% (Harvard Business Review, March 2022). The survey asked whether meetings were unproductive and inefficient, not whether they were "ineffective at their stated purpose".
|
||||
- **Resolution made:** `README.md` — "What We Have Learned" now gives the survey figure with its scope, "Seventy-one percent of 182 surveyed senior managers reported that meetings are unproductive and inefficient [rogelberg-2019]"; mirrored in `public/src/data/manifesto.js` — `researchStats`, which carries 71% [rogelberg-2019].
|
||||
- **Disposition:** reworded — "Seventy-one percent of 182 surveyed senior managers … [rogelberg-2019]" replaces "72% of meetings are ineffective at their stated purpose", and the claim now says what the survey asked.
|
||||
|
||||
### WP-16 — The NOW limit is stated two ways
|
||||
|
||||
- **Location:** `README.md` — "Prioritization" and "Appendix: Quick Reference" → "The Numbers"
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "**NOW** — Critical, blocking, time-sensitive. Maximum five items." and "| NOW items | Max 3-5 |"
|
||||
- **Why:** The same limit is five in one section and a three-to-five range in the other, in the same document.
|
||||
- **Resolution made:** `README.md` — "Prioritization" and "Appendix: Quick Reference" → "The Numbers" now state one limit: "Maximum five items — a BEAT default, listed in the constraints table" (Prioritization) and the row "NOW items | Max 5" (The Numbers); mirrored in `public/src/data/manifesto.js` — `priorityBuckets[0].description` and `constraints`.
|
||||
- **Disposition:** reworded — "Maximum five items — a BEAT default, listed in the constraints table." The "Max 3-5" range is gone.
|
||||
|
||||
### WP-17 — Exploration time: 20% and one day per beat cannot both hold
|
||||
|
||||
- **Location:** `README.md` — Principle 12 and "Appendix: Quick Reference" → "The Numbers"
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "Twenty percent of time belongs to the maker for learning, tooling, experiments, and interests." and "| Exploration time | 20% (1 day/beat) |"
|
||||
- **Why:** One day per beat is 20% only if a beat is exactly five working days, but a beat is "flexible iterations of one to two weeks". At ten working days the same rule gives 10%.
|
||||
- **Resolution made:** `README.md` — Principle 12 now states one unit, "A fifth of each maker's working time belongs to learning, tooling, experiments, and interests — a BEAT default, listed in the constraints table.", and "Appendix: Quick Reference" → "The Numbers" carries the row "Exploration time | 20% of working time"; mirrored in `public/src/data/manifesto.js` — `principles.sustainability[2].description` and `constraints`.
|
||||
- **Deviation from plan:** the one-day-per-beat wording and the `public/src/views/HomeView.vue` — `keyNumbers` copy were dropped instead of being carried in a second unit; the percentage is now the only unit on both sides.
|
||||
- **Disposition:** reworded — "A fifth of each maker's working time belongs to learning, tooling, experiments, and interests — a BEAT default, listed in the constraints table." The same figure in `README.md` — "Burnout Prevention" was reworded: "**Protect exploration time.** A fifth of each maker's working time, moved to the next beat and recorded when the team is busy." replaces "**Protect exploration time.** One day per beat."; the option description in `public/src/data/assessment.js` — `assessmentQuestions[11].options[3].description` was reworded: "20% of working time for exploration — a BEAT default, listed in the constraints table" replaces "20% for exploration built in".
|
||||
|
||||
### WP-18 — The assessment uses two different scoring thresholds
|
||||
|
||||
- **Location:** `public/src/data/assessment.js` — `overallAssessment` and `public/src/views/AssessmentView.vue` — `overallLevel`, `categoryScores`
|
||||
- **Category:** wrong number
|
||||
- **Original wording:** "range: [12, 24]", "range: [25, 36]", "range: [37, 42]", "range: [43, 48]" and "level: total <= max * 0.4 ? 'low' : total <= max * 0.7 ? 'medium' : 'high'"
|
||||
- **Why:** The overall scale calls 37 of 48 (77%) "strong" and 43 of 48 (90%) "excellent", while a category is called "high" from 71% of its maximum. A team can therefore score "excellent" overall while every category reads only "high", and the two bands disagree on the same percentages.
|
||||
- **Resolution made:** `public/src/data/assessment.js` — `overallAssessment.scoring` now carries one threshold set plus a separate band statement: `categoryThresholds` reads "BEAT's own scoring rule, not a research finding: a category is low below 40 percent of that category's own maximum, medium from 40 to 70 percent of it, and high above 70 percent. The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, high 43 to 48.", with the new `bandCuts` (12–24 "Significant Opportunity for Improvement", 25–36 "Building Better Practices", 37–42 "Strong Foundation", 43–48 "BEAT-Ready Team") and `derivation` fields; `public/src/views/AssessmentView.vue` computes the category level from one rule (`levelFor`, 0.4 and 0.7 of the category maximum) and reads the bands from `overallAssessment.scoring.bandCuts` (`bandFor`); `README.md` — "The Self-Assessment" (anchor `assessment-scoring`) states the same rule and the validity note. The README side of the repair is now complete: card `776499a9` changed the scoring paragraph in `README.md` — "The Self-Assessment" (line 698) to "The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, and high 43 to 48.", so both mirrors now state the same position.
|
||||
- **Deviation from plan:** the repair of the README wording landed on a later card, `776499a9`, because the README was outside this card's file. `README.md` — "The Self-Assessment" (line 698) said "The same two cuts give the four overall bands", which is the false arithmetic this entry was raised about, while the data side said the bands are "a separate BEAT choice … not produced by those two percentage cuts". Card `776499a9` changed the README sentence to the data wording, so the difference this line records is closed.
|
||||
- **Disposition:** reworded — the two disagreeing threshold sets are replaced by one category rule plus an explicitly separate band list, on both sides: `README.md` — "The Self-Assessment" now reads "The thresholds are BEAT's own scoring rule, not a research finding: a category is low below 40 percent of its maximum, medium from 40 to 70 percent, and high above 70 percent. The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, and high 43 to 48."
|
||||
|
||||
---
|
||||
|
||||
## Self-contradiction
|
||||
|
||||
### WP-19 — Sacred blocks are absolute, then suspended by anything urgent
|
||||
|
||||
- **Location:** `README.md` — Principle 1 and "The BEAT Commitment", against "Incidents & Emergencies"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "We maintain sacred blocks of four hours daily where no meetings, messages, or interruptions are permitted." and "**Protecting focus** — We will not interrupt sacred time. We will wait." against "**During incidents:**" and "Sacred blocks are suspended"
|
||||
- **Why:** The principle and the commitment are absolute ("above all else", "no interruptions are permitted"); the incident carve-out is not scoped — it names no role that may suspend a block, no time box, no rotation, and it can be invoked by anyone who judges something an incident.
|
||||
- **Resolution made:** `README.md` — Principle 1 now scopes the exception: "The only exception is a declared production incident: the incident lead may suspend a block, and only for the time the incident runs." and "Incidents & Emergencies" repeats it under "**During incidents:** The incident lead may suspend a sacred block, and only for the time the incident runs"; mirrored in `public/src/data/manifesto.js` — `principles.focus[0].description` and `incidentProtocol`, rendered by `public/src/views/PracticesView.vue` — "Incident protocol".
|
||||
- **Resolved position:** the block is absolute except for a declared production incident, and only the incident lead may suspend it, for the duration of the incident.
|
||||
- **Disposition:** reworded — "The only exception is a declared production incident: the incident lead may suspend a block, and only for the time the incident runs."
|
||||
|
||||
### WP-20 — "Pull, don't push" against "The Enabler sets the stack"
|
||||
|
||||
- **Location:** `README.md` — Principle 8 and "Prioritization"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "Work is not assigned. Work is pulled by those with capacity and interest." and "The Enabler sets the stack. Makers may adjust with reason."
|
||||
- **Why:** The Enabler ordering the stack is assignment-adjacent; who may set the stack, on what basis, and how a maker disputes the order are all undefined.
|
||||
- **Resolution made:** `README.md` — Principle 8 now states "The Enabler orders the stack — priority and order, never assignment — and makers pull from the top of it. A maker may skip an item with a reason, propose an alternative, and object to the order through the dispute path in the priority rules."; mirrored in `public/src/data/manifesto.js` — `principles.autonomy[1].description` and `roles[1].description` ("they set order and capacity, never assignment").
|
||||
- **Resolved position:** the Enabler orders the stack by priority and order and never assigns; the maker pulls, may skip with a reason, and objects through the dispute path.
|
||||
- **Disposition:** reworded — "The Enabler orders the stack — priority and order, never assignment — and makers pull from the top of it." The site mirror was reworded in the same pass: `public/src/views/FrameworkView.vue` no longer renders the "Prioritization Buckets" heading, which named the board structure as a fixed set of buckets; the page now renders "Priority buckets" in a `PageSection`, and the bucket rules live in `manifesto.js` — `priorityBuckets`.
|
||||
|
||||
### WP-21 — Maker autonomy over how, against a team-owned definition of done
|
||||
|
||||
- **Location:** `README.md` — Principle 7 and "Definition of Done"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "Those who build the thing decide how to build it. They choose their tools, their approach, their schedule, their collaborators." against "**The team owns this definition.** Adjust it as needed. But once agreed, honor it." with "Code reviewed by at least one other maker"
|
||||
- **Why:** A maker's freedom is stated as absolute over method, while the done criteria — including a review the maker cannot satisfy alone — are owned by the team, and no path exists for a maker who disagrees with the done condition.
|
||||
- **Resolution made:** `README.md` — Principle 7 now separates the two: "Method is the maker's. The done condition is the team's, and a maker who cannot meet one raises it before the work starts, not after.", and "Definition of Done" adds "If a maker cannot meet a condition, they raise it before the work starts; the team either changes the condition or the work does not start."; mirrored in `public/src/data/manifesto.js` — `principles.autonomy[0].description` and `definitionOfDone.code`.
|
||||
- **Resolved position:** method belongs to the maker, the done condition to the team, and disagreement is raised before the work starts, where the team either changes the condition or the work does not start.
|
||||
- **Disposition:** reworded — "Method is the maker's. The done condition is the team's, and a maker who cannot meet one raises it before the work starts, not after."
|
||||
|
||||
### WP-22 — The weekly meeting budget against the incident update cadence
|
||||
|
||||
- **Location:** `README.md` — Principle 5 and "Incidents & Emergencies"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "We limit them to two hours per week, one hour maximum each." against "3. **Communicate** — Brief status updates every 30 minutes until resolved."
|
||||
- **Why:** A sustained incident produces 30-minute updates for as long as it runs, which exceeds the weekly meeting budget and the one-hour maximum; the exception is not time-boxed and no owner is named for it.
|
||||
- **Resolution made:** `README.md` — Principle 5 now names the exception, "a declared incident is the only exception", and "Incidents & Emergencies" states it with an owner and a time box: "The meeting budget does not apply during an incident; the incident lead decides when normal rules resume." plus "Status updates every half hour until the incident is stable." and "Async post-mortem within two days."; mirrored in `public/src/data/manifesto.js` — `principles.communication[1].description` and `incidentProtocol`.
|
||||
- **Deviation from plan:** the incident protocol is now a step list (`incidentProtocol.steps`), not the single `incidentProtocol[2]` the plan named.
|
||||
- **Resolved position:** the weekly meeting budget applies except during a declared incident, where the incident lead runs the updates and decides when normal rules resume.
|
||||
- **Disposition:** reworded — "The meeting budget does not apply during an incident; the incident lead decides when normal rules resume." The same figure in `README.md` — "Incidents & Emergencies" step 5 and in `public/src/data/manifesto.js` — `incidentProtocol[4].description` was reworded: "Async post-mortem within two days. No blame. Root cause and prevention, with the action items tracked to completion." replaces "Async post-mortem within 48 hours. No blame. Root cause and prevention."
|
||||
|
||||
### WP-23 — "We do not assign buddies" against the onboarding buddy
|
||||
|
||||
- **Location:** `README.md` — "Collaboration" against "Onboarding to BEAT" → "Connector's Responsibility"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "We do not schedule pairing. We do not mandate walkthroughs. We do not assign buddies." against "New member has a \"buddy\" for questions (informal, not mandatory pairing)"
|
||||
- **Why:** The prose prohibition and the onboarding promise are in direct conflict; the parenthetical "not mandatory pairing" does not resolve it, because the issue is whether a buddy is assigned at all.
|
||||
- **Resolution made:** `README.md` — "Collaboration" now reads "We do not schedule pairing. We do not mandate walkthroughs. Collaboration is initiated by those who need it. Where a team adds a mentor for a new member, that is the onboarding ramp, not a standing pairing: the mentor's time is planned capacity like any other work.", and "Onboarding to BEAT" → "What We Don't Do" keeps "Assign a mandatory buddy for months" as a negative; mirrored in `public/src/data/manifesto.js` — `onboarding` (`juniorTeams`) and `public/src/views/OnboardingView.vue`.
|
||||
- **Deviation from plan:** the planned view section `public/src/views/OnboardingView.vue` — "Connector's Responsibility" was not created; the reconciliation landed in `README.md` — "Collaboration", "What We Don't Do" and "On Junior-Heavy Teams", in `manifesto.js` — `onboarding`, and in `OnboardingView.vue`. `README.md` — "Connector's Responsibility" still exists; the site data has no counterpart key for it.
|
||||
- **Resolved position:** BEAT assigns no buddy; a team that adds a mentor for a new member does so as part of the onboarding ramp, and the mentor's time is planned capacity.
|
||||
- **Disposition:** reworded — "Where a team adds a mentor for a new member, that is the onboarding ramp, not a standing pairing: the mentor's time is planned capacity like any other work."
|
||||
|
||||
### WP-24 — "Everything else waits" against auto-proceed on reviews
|
||||
|
||||
- **Location:** `README.md` — Principle 6, "Avoiding Chokepoints" → "Reviews", against "Definition of Done"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "Urgent means phone call. Everything else waits." and "**Reviews:** Anyone can review. Four-hour response SLA. Auto-proceed after 24 hours if CI passes." against "Code reviewed by at least one other maker"
|
||||
- **Why:** Auto-proceed after 24 hours merges code that has not been reviewed, which the definition of done forbids and the anti-pattern table lists as the fix for review blocking ("Anyone can review, auto-proceed rule"). The rule also states no exception for security-sensitive changes.
|
||||
- **Resolution made:** `README.md` — "Avoiding Chokepoints" → "Reviews" now names the merge owner and the exceptions: "Auto-proceed after 24 working hours if the build passes: the author merges, or asks the Enabler to merge, once the window closes. A change with security, data-migration or billing impact, and a change to a dependency other teams consume, waits for a named reviewer and never auto-proceeds. Open review comments also stop auto-proceed: the author answers them or asks for a named reviewer.", and "Definition of Done" now reads "Code reviewed by at least one other maker, or auto-proceeded under the review rule with the exceptions in that rule named in the merge"; mirrored in `public/src/data/manifesto.js` — `definitionOfDone.code` and `decisionRules` — "Auto-proceed" and "Review response".
|
||||
- **Resolved position:** auto-proceed is the exception, not the default: the build must pass, the window must close, the author or the Enabler merges, and security, data-migration, billing and cross-team dependency changes plus unanswered review comments never auto-proceed.
|
||||
- **Disposition:** reworded — "Code reviewed by at least one other maker, or auto-proceeded under the review rule with the exceptions in that rule named in the merge".
|
||||
|
||||
### WP-25 — "Decisions not documented did not happen" against silence-as-consent
|
||||
|
||||
- **Location:** `README.md` — Principle 4 and Principle 9, against "Avoiding Chokepoints" → "Decisions"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "Decisions not documented did not happen." against "**Decisions:** Post recommendation. Wait 24 hours. No objection means proceed." and "Makers may refuse work that is unethical, impossible, or poorly conceived."
|
||||
- **Why:** Silence-as-consent is a decision without documentation, and a maker's silence is treated as agreement while their explicit refusal is treated as ownership — the same silence carries opposite meanings depending on who is silent.
|
||||
- **Resolution made:** `README.md` — Principle 4 now requires the record: "We write by default. A decision counts only when it is written down and the record names who decided it — silence is not consent.", Principle 9 keeps refusal as ownership, "A refusal is a decision and is recorded like any other: this is not insubordination—it is ownership.", and "Avoiding Chokepoints" → "Decisions" now separates no objection from consent: "Post a recommendation naming the owner. Wait 24 working hours — a BEAT default, not a research finding. No objection means the decision is recorded and stands; silence is not consent on its own, so the record says who decided."; mirrored in `public/src/data/manifesto.js` — `principles.communication[0].description`, `principles.autonomy[2].description` and `decisionRules` — "Decisions" ("Nobody objects within 24 working hours — a BEAT default, not a research finding — and the decision is recorded.").
|
||||
- **Resolved position:** a decision counts when it is written and names who decided it; silence is not consent, and a refusal is a recorded decision like any other.
|
||||
- **Disposition:** reworded — "We write by default. A decision counts only when it is written down and the record names who decided it — silence is not consent."
|
||||
|
||||
### WP-26 — "No known defects introduced" against shipping logged defects
|
||||
|
||||
- **Location:** `README.md` — "Spotted Issues" against "Definition of Done"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "**More than five minutes, not blocking?** Log it, continue. Protect your focus." and "No known defects introduced" and "\"Done\" means done—not \"done but...\" or \"done except...\""
|
||||
- **Why:** A logged defect found during the work ships inside the merged item, which the done criteria forbid, and the text nowhere distinguishes "not done" from "done with a logged defect".
|
||||
- **Resolution made:** `README.md` — "Spotted Issues" now says "A spotted issue that is logged as its own item does not block the work that found it, provided it is recorded before the merge.", and "Definition of Done" carries the matching criterion "No known defects introduced: a defect found during the work and logged as its own item does not block this one, provided it is recorded before the merge"; mirrored in `public/src/data/manifesto.js` — `definitionOfDone.code`.
|
||||
- **Deviation from plan:** the planned view sections `public/src/views/PracticesView.vue` and `public/src/views/ReferenceView.vue` — "Spotted Issue Decision" do not exist at the branch head; the rule is carried by `README.md` — "Spotted Issues" and "Definition of Done", and by `manifesto.js` — `definitionOfDone.code`.
|
||||
- **Resolved position:** a defect found during the work and logged as its own item does not block the item, provided it is recorded before the merge.
|
||||
- **Disposition:** reworded — "A spotted issue that is logged as its own item does not block the work that found it, provided it is recorded before the merge." The site mirror changed in the same pass: `public/src/views/ReferenceView.vue` no longer renders the "Spotted Issue Decision" cards, whose questions "5 minutes or less?" and "More than 5 minutes?" were BEAT's own figures, and its "Incident Protocol" heading was reworded to "Incident protocol" in a `PageSection`; the rule now lives in `README.md` — "Spotted Issues" and in `manifesto.js` — `definitionOfDone.code`.
|
||||
|
||||
### WP-27 — Exploration work has no place on the board
|
||||
|
||||
- **Location:** `README.md` — Principle 12 against "The Board"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "No justification required. No approval needed." against "ICE → LATER → NEXT → IN PROGRESS → DONE" and "Work-in-progress limit: three per maker."
|
||||
- **Why:** Exploration is a standing claim on a maker's time, but the board has no lane for it and the WIP limit does not say whether exploration counts against the three items — so a maker can either exceed the limit or abandon the exploration entitlement.
|
||||
- **Resolution made:** `README.md` — Principle 12 now answers the board question: "Exploration does not consume a work-in-progress slot and does not sit on the board: it is scheduled, not tracked as work.", and "Burnout Prevention" adds "**Protect exploration time.** A fifth of each maker's working time, moved to the next beat and recorded when the team is busy."; mirrored in `public/src/data/manifesto.js` — `principles.sustainability[2].description` and `decisionRules` — "Exploration time".
|
||||
- **Deviation from plan:** the planned view mirror `public/src/views/FrameworkView.vue` — "The Board" was not given a separate exploration rule; the rule is carried in `README.md` — Principle 12 and "Burnout Prevention", and in `manifesto.js`.
|
||||
- **Resolved position:** exploration is scheduled time, not board work: it consumes no work-in-progress slot and is moved to the next beat and recorded when the team is busy.
|
||||
- **Disposition:** reworded — "Exploration does not consume a work-in-progress slot and does not sit on the board: it is scheduled, not tracked as work."
|
||||
|
||||
### WP-28 — "We plan at 80%" against an uncapped NOW bucket
|
||||
|
||||
- **Location:** `README.md` — Principle 10 against "Prioritization"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "We plan at 80% and leave slack for life." against "**NOW** — Critical, blocking, time-sensitive. Maximum five items."
|
||||
- **Why:** The bucket system has no capacity check; five critical items can exceed 80% of capacity, and the tie-break between "cut scope" and "take the work" is not stated, so capacity and priority are in unresolved conflict rather than a resolved one.
|
||||
- **Resolution made:** `README.md` — Principle 10 now names the tie-break: "The capacity plan belongs to the Enabler, is set per maker for each beat at eighty percent of that maker's available working time, and says what does not fit. When a NOW item would break the plan, the deadline moves before the rest does.", and "Prioritization" states it for the bucket: "Maximum five items — a BEAT default, listed in the constraints table. When the bucket needs more than the capacity plan allows, the plan wins: the deadline moves or the scope shrinks."; mirrored in `public/src/data/manifesto.js` — `principles.sustainability[0].description`, `priorityBuckets[0].description` and `decisionRules` — "NOW bucket limit" and "Planning capacity".
|
||||
- **Resolved position:** the capacity plan wins over the NOW bucket; a NOW item that breaks the plan has its deadline moved, or its scope cut.
|
||||
- **Disposition:** reworded — "When the bucket needs more than the capacity plan allows, the plan wins: the deadline moves or the scope shrinks." The same table row in `README.md` — "Anti-Patterns" → "Process Anti-Patterns" was completed: "| **Permanent NOW** | Everything is urgent, always | If everything is NOW, nothing is. The Enabler returns items to NEXT until the bucket is inside its limit |" replaces "| **Permanent NOW** | Everything is urgent, always | If everything is NOW, nothing is |".
|
||||
|
||||
### WP-29 — Onboarding promise against "Where BEAT Fits"
|
||||
|
||||
- **Location:** `README.md` — "Onboarding to BEAT" against "Where BEAT Fits"
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "- Expect full productivity in week one" against "- Junior-heavy teams needing close guidance"
|
||||
- **Why:** The manifesto claims BEAT fits junior-heavy teams poorly while its onboarding section promises a gradual ramp that is the only support a junior would get; neither section says which of the two wins for a junior team.
|
||||
- **Resolution made:** `README.md` — "Where BEAT Fits" now states the exception in the poor-fit list, "Junior-heavy teams needing close guidance, unless the team adds a mentor alongside the BEAT ramp", and "Onboarding to BEAT" gained "On Junior-Heavy Teams"; mirrored in `public/src/data/manifesto.js` — `whereItFits.fitsPoorly` and `onboarding.juniorTeams`, rendered by `public/src/views/AntiPatternsView.vue` and `public/src/views/OnboardingView.vue`.
|
||||
- **Resolved position:** BEAT fits a junior-heavy team poorly unless the team adds a mentor alongside the ramp; that is what the team must add.
|
||||
- **Disposition:** reworded — "Junior-heavy teams needing close guidance, unless the team adds a mentor alongside the BEAT ramp".
|
||||
|
||||
---
|
||||
|
||||
## Rule not applicable as written
|
||||
|
||||
### WP-30 — "Urgent means phone call" cannot be executed
|
||||
|
||||
- **Location:** `README.md` — Principle 6 and "Incidents & Emergencies"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "Urgent means phone call. Everything else waits." and "**Alert** — Post immediately in dedicated incident channel. Phone/page if needed."
|
||||
- **Why:** No phone or paging channel is named, nobody is authorised to declare something urgent, there is no fallback when no one answers, and no rule for a maker in another time zone.
|
||||
- **Resolution made:** `README.md` — Principle 6 now names the channel and the fallback: "Urgent means a phone call to the on-call rota, and the rota names the fallback when nobody answers.", and "Incidents & Emergencies" names the owner and the clock: step 1 "The on-call rota names who to call and the fallback when nobody answers.", step 2 "Someone claims ownership within fifteen minutes … and becomes the incident lead for the rest of the incident."; mirrored in `public/src/data/manifesto.js` — `principles.communication[2].description` and `incidentProtocol`, and in `public/src/data/assessment.js` — `assessmentQuestions[5].options[3].description` ("Urgent = phone, else async").
|
||||
- **Resolved position:** urgent is a phone call to the on-call rota, the rota names the fallback, and whoever claims ownership within fifteen minutes becomes the incident lead.
|
||||
- **Disposition:** reworded — "Urgent means a phone call to the on-call rota, and the rota names the fallback when nobody answers." The same figure in `README.md` — "Incidents & Emergencies" step 2 and in `public/src/data/manifesto.js` — `incidentProtocol[1].description` was reworded: "Someone claims ownership within fifteen minutes of the alert, and becomes the incident lead for the rest of the incident." replaces "Someone claims ownership within 15 minutes."
|
||||
|
||||
### WP-31 — "24 working hours" is undefined
|
||||
|
||||
- **Location:** `README.md` — Principle 6
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "We expect responses within 24 working hours."
|
||||
- **Why:** "Working hours" is not defined per time zone or per working day, nobody owns the expectation, and no behaviour is stated for leave or absence. A maker in a far time zone cannot know when the clock starts.
|
||||
- **Resolution made:** `README.md` — new "Working across Time Zones" (anchor `timeZones`) defines the clock: "Every rule in BEAT that counts time runs on the team's stated coverage hours, in working hours. Here is the reference time zone those hours are counted in." with coverage hours, reference time zone and overlap hours; mirrored in `public/src/data/manifesto.js` — `timeZones` and `principles.communication[2].description` ("We expect a response within 24 working hours — the BEAT default, listed in the constraints table — counted against the coverage hours in the time-zone rules."), and in `public/src/data/assessment.js` — `assessmentQuestions[4].options[2].description` ("24 working hours — a BEAT default, listed in the constraints table"). The README side of the repair is now complete: card `77cc3e22` changed Principle 6 to "We expect a response within 24 working hours — the BEAT default, listed in the constraints table — counted against the coverage hours in the time-zone rules.", changed the "Prioritization" dispute timeout and the "Avoiding Chokepoints" → "Decisions" wait to "24 working hours — a BEAT default, not a research finding", and changed this lead-in to the sentence quoted above, so `README.md` and the data side now state the same clock.
|
||||
- **Deviation from plan:** the README repair landed on a later card, `77cc3e22`, because the README was outside this card's file. `README.md` said "We expect a response within one working day, counted against the coverage hours in the time-zone rules" (and "one working day" also appeared in "Prioritization" and in the "Working across Time Zones" lead-in), while the data said "24 working hours". Card `77cc3e22` changed all three README sentences to the data wording, so the difference this line records is closed and both wordings are no longer in play.
|
||||
- **Resolved position:** every time-based rule counts working hours, defined by the team's coverage hours and reference time zone, and the expectation is 24 working hours — a BEAT default, not a research finding.
|
||||
- **Disposition:** reworded — "We expect a response within 24 working hours — a BEAT default, listed in the constraints table — counted against the coverage hours in the time-zone rules." The same figure in `public/src/data/assessment.js` — `assessmentQuestions[4].options[2].description` was reworded: "24 working hours — a BEAT default, listed in the constraints table" replaces "24-hour response is acceptable", so the option and the README now state the same clock. The option list was also extended with a faster band, { value: 2, label: 'Within hours', description: 'Same-day responses expected' }, so the question offers hours, a day and longer rather than a single unsourced clock.
|
||||
|
||||
### WP-32 — The stale-item sweep has no trigger, owner, or exception
|
||||
|
||||
- **Location:** `README.md` — "The Board"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "Items stale for five days return to backlog."
|
||||
- **Why:** Staleness has no definition (no last-activity field on the board), no one performs the sweep, and there is no way to pin an item that is intentionally parked.
|
||||
- **Resolution made:** `README.md` — "The Board" now defines staleness, the owner and the exception: "Items with no activity for five working days return to the backlog, unless the maker pins them as intentionally parked; the pin is reviewed at the next beat close, and an unpinned item returns to the backlog. The Enabler sweeps the board at each beat close."; mirrored in `public/src/data/manifesto.js` — `decisionRules` — "Stale-item sweep".
|
||||
- **Deviation from plan:** the sweep landed in `decisionRules` — "Stale-item sweep", not in `constraints` as planned, and the planned `public/src/views/FrameworkView.vue` — "Stale Items" section does not exist at the branch head.
|
||||
- **Resolved position:** an item with no activity for five working days returns to the backlog unless the maker pins it as intentionally parked; the pin is reviewed at the next beat close, and the Enabler sweeps the board at each beat close.
|
||||
- **Disposition:** reworded — "Items with no activity for five working days return to the backlog, unless the maker pins them as intentionally parked." The site mirror changed in the same pass: `public/src/views/FrameworkView.vue` no longer renders the "Stale Items" card, whose text "Return to backlog after 5 days" stated the outcome without its trigger; the rule now lives in `manifesto.js` — `decisionRules` — "Stale-item sweep".
|
||||
|
||||
### WP-33 — Auto-proceed has no owner or exceptions
|
||||
|
||||
- **Location:** `README.md` — "Avoiding Chokepoints" → "Reviews"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "**Reviews:** Anyone can review. Four-hour response SLA. Auto-proceed after 24 hours if CI passes."
|
||||
- **Why:** No one is named to perform the merge, the rule says nothing about a review that raised substantive comments but was not answered, and no security-sensitive or data-migration exception is carved out.
|
||||
- **Resolution made:** `README.md` — "Avoiding Chokepoints" → "Reviews" now names the merge owner, the response window and the exceptions: "Four working-hour response window, counted inside the coverage hours of the reference time zone. Auto-proceed after 24 working hours if the build passes: the author merges, or asks the Enabler to merge, once the window closes. A change with security, data-migration or billing impact, and a change to a dependency other teams consume, waits for a named reviewer and never auto-proceeds. Open review comments also stop auto-proceed: the author answers them or asks for a named reviewer."; mirrored in `public/src/data/manifesto.js` — `decisionRules` — "Review response" and "Auto-proceed", and `constraints` ("Review response | 4 working hours", "Auto-proceed | 24 working hours").
|
||||
- **Deviation from plan:** the planned view sections `public/src/views/FrameworkView.vue` — "The Numbers" and `public/src/views/ReferenceView.vue` — "The Numbers" do not exist at the branch head; the rule lives in `README.md` — "Avoiding Chokepoints" → "Reviews", and in `manifesto.js` — `decisionRules`.
|
||||
- **Resolved position:** the author or the Enabler merges after 24 working hours once the window closes and the build passes, except for security, data-migration, billing and cross-team dependency changes and for open review comments.
|
||||
- **Disposition:** reworded — "Auto-proceed after 24 working hours if the build passes: the author merges, or asks the Enabler to merge, once the window closes."
|
||||
|
||||
### WP-34 — The WIP limit says what the limit is, not what to do at the limit
|
||||
|
||||
- **Location:** `README.md` — "The Board"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "Work-in-progress limit: three per maker."
|
||||
- **Why:** No owner, no stated consequence of reaching three, and no rule for a maker who is at the limit while the only remaining work is blocked.
|
||||
- **Resolution made:** `README.md` — "The Board" now states the owner, the consequence and the blocked-work case: "Work-in-progress limit: three per maker. The maker stops taking new work at the limit. If the maker is blocked and every remaining item is blocked too, they say so in the check-in and the Enabler unblocks or reorders."; mirrored in `public/src/data/manifesto.js` — `decisionRules` — "Work-in-progress limit" and `constraints` ("WIP per maker | 3 items").
|
||||
- **Deviation from plan:** the rule landed in `decisionRules` — "Work-in-progress limit"; the planned `public/src/views/FrameworkView.vue` — "WIP Limit" section does not exist at the branch head.
|
||||
- **Resolved position:** at three items the maker stops taking new work; if the maker and every remaining item are blocked, the maker says so in the check-in and the Enabler unblocks or reorders.
|
||||
- **Disposition:** reworded — "The maker stops taking new work at the limit." The site mirror changed in the same pass: `public/src/views/FrameworkView.vue` no longer renders the "WIP Limit" card, whose text "3 items per maker" gave the limit without what to do at it; the rule now lives in `manifesto.js` — `decisionRules` — "Work-in-progress limit".
|
||||
|
||||
### WP-35 — "We do not groom" has no scope and no exception
|
||||
|
||||
- **Location:** `README.md` — "Work Items"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "We size with **S/M/L**, not story points. We do not groom. We do not point. We do not track velocity."
|
||||
- **Why:** Three prohibitions with no scope (team-internal planning only, or every reporting obligation?) and no exception path for a team that must report to an external programme or a regulated customer.
|
||||
- **Resolution made:** `README.md` — "Work Items" now states the scope and the exception: "Sizing applies to team-internal planning. A team that must report to an external programme, a regulator or a regulated customer keeps that reporting obligation and adapts the method around it."; mirrored in `public/src/data/manifesto.js` — `decisionRules` — "Sizing".
|
||||
- **Deviation from plan:** the rule landed in `decisionRules` — "Sizing", not in `constraints`, and the planned `public/src/views/FrameworkView.vue` — "Work Items" section does not exist at the branch head.
|
||||
- **Resolved position:** sizing applies to team-internal planning; an external reporting obligation is kept and the method is adapted around it.
|
||||
- **Disposition:** reworded — "Sizing applies to team-internal planning. A team that must report to an external programme, a regulator or a regulated customer keeps that reporting obligation and adapts the method around it."
|
||||
|
||||
### WP-36 — "Claim files" has no mechanism
|
||||
|
||||
- **Location:** `README.md` — "Avoiding Chokepoints" → "Merges"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "**Merges:** Merge main daily. Claim files. Keep branches short-lived."
|
||||
- **Why:** "Claim files" names no mechanism (a lock, a branch-protection rule, a board column), no conflict rule, and no owner; "daily" cannot be enforced without a definition of the working day across time zones.
|
||||
- **Resolution made:** `README.md` — "Avoiding Chokepoints" → "Merges" now names the mechanism and the conflict rule: "Claim files in the branch protection rule before you start; when two makers claim the same file, the earlier claim stands and the later one re-plans around it. … A day is a working day in the reference time zone."; mirrored in `public/src/data/manifesto.js` — `decisionRules` — "Claiming files", and in `technicalPractices` — "Trunk-Based Development", which carries the claim-files rule.
|
||||
- **Resolved position:** files are claimed in the branch protection rule before work starts; the earlier claim stands and the later maker re-plans around it, and a day is a working day in the reference time zone.
|
||||
- **Disposition:** reworded — "Claim files in the branch protection rule before you start; when two makers claim the same file, the earlier claim stands and the later one re-plans around it."
|
||||
|
||||
### WP-37 — "We plan at 80%" names neither a planner nor a unit
|
||||
|
||||
- **Location:** `README.md` — Principle 10 and "Burnout Prevention"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "We plan at 80% and leave slack for life." and "**Plan at 80%.** Leave room for spotted issues, complexity, life."
|
||||
- **Why:** No one is named as planning, 80% is not defined as a percentage of what (per maker, per team, per beat), and there is no instruction for what to plan first when demand exceeds capacity.
|
||||
- **Resolution made:** `README.md` — Principle 10 now names the planner, the unit and the base: "The capacity plan belongs to the Enabler, is set per maker for each beat at eighty percent of that maker's available working time, and says what does not fit.", and "Burnout Prevention" repeats it: "**Plan at 80%.** The Enabler sets the capacity plan per maker for each beat, at eighty percent of that maker's available working time, and the plan says what does not fit."; mirrored in `public/src/data/manifesto.js` — `principles.sustainability[0].description`, `constraints` ("Planning capacity | 80% of available working time") and `decisionRules` — "Planning capacity".
|
||||
- **Resolved position:** the Enabler plans, per maker, per beat, at eighty percent of that maker's available working time, and the plan states what does not fit.
|
||||
- **Disposition:** reworded — "The capacity plan belongs to the Enabler, is set per maker for each beat at eighty percent of that maker's available working time, and says what does not fit." The same figure in `public/src/data/assessment.js` — `beatRecommendations.sustainability.medium.recommendations[2]` was reworded: "Review capacity planning—are you over 80% of your working time? (a BEAT default, listed in the constraints table)" replaces "Review capacity planning—are you over 80%?".
|
||||
|
||||
### WP-38 — The four-hour review SLA has no coverage hours
|
||||
|
||||
- **Location:** `README.md` — "Avoiding Chokepoints" → "Reviews"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "Four-hour response SLA."
|
||||
- **Why:** Four hours of whose day is not stated, no owner of the SLA, and the assessment instrument does not ask about review turnaround at all, so the rule is never exercised.
|
||||
- **Resolution made:** `README.md` — "Avoiding Chokepoints" → "Reviews" now defines the window: "Four working-hour response window, counted inside the coverage hours of the reference time zone.", and "Working across Time Zones" defines those coverage hours and the reference time zone; mirrored in `public/src/data/manifesto.js` — `constraints` ("Review response | 4 working hours"), `decisionRules` — "Review response" and `timeZones`.
|
||||
- **Resolved position:** the four-hour window is counted inside the coverage hours of the team's reference time zone, as defined in "Working across Time Zones".
|
||||
- **Disposition:** reworded — "Four working-hour response window, counted inside the coverage hours of the reference time zone."
|
||||
|
||||
### WP-39 — "Meet team members 1:1 (async or sync, their preference)"
|
||||
|
||||
- **Location:** `README.md` — "Onboarding to BEAT" → "Week One: Observe"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "Meet team members 1:1 (async or sync, their preference)"
|
||||
- **Why:** An asynchronous 1:1 is not defined, no cadence, owner or tooling is given, and it sits against the earlier finding that the onboarding section assigns a buddy but the collaboration section forbids it.
|
||||
- **Resolution made:** `README.md` — "Onboarding to BEAT" → "Week One" now names the arranger and what counts: "Meet team members one to one: the Connector or the Enabler arranges it, you choose the format and the time, and a written exchange counts as a meeting"; mirrored in `public/src/data/manifesto.js` — `onboarding.weekOne.items[4], which carries the same sentence.
|
||||
- **Deviation from plan:** no recurring cadence was added; the repair names the arranger (the Connector or the Enabler), leaves the format and the time to the new member, and says that a written exchange counts as a meeting.
|
||||
- **Resolved position:** the Connector or the Enabler arranges the one-to-one, the new member chooses the format and the time, and a written exchange counts as a meeting.
|
||||
- **Disposition:** reworded — "Meet team members one to one: the Connector or the Enabler arranges it, you choose the format and the time, and a written exchange counts as a meeting".
|
||||
|
||||
### WP-40 — "We aim; we do not promise" has no path for promises already made
|
||||
|
||||
- **Location:** `README.md` — "Beats" against "Anti-Patterns" → "Organizational Anti-Patterns"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "Beats have **goals**, not commitments. We aim; we do not promise." against "| **Stealth deadlines** | Surprise \"we promised client by Friday\" | Surface commitments before making them |"
|
||||
- **Why:** The anti-pattern forbids hidden commitments, but a commitment already made to a customer — openly, by someone else — falls outside every rule; nothing says who renegotiates it or what the maker does with it.
|
||||
- **Resolution made:** `README.md` — "Beats" now states the path for a commitment that already exists: "A commitment made outside the team is renegotiated by whoever made it, with the Enabler helping, and the team hears about it before the next beat starts.", and "Anti-Patterns" → "Organizational" now reads "Surface commitments before making them. A commitment already made outside the team is renegotiated by whoever made it"; mirrored in `public/src/data/manifesto.js` — `antiPatterns.organizational[1]`.
|
||||
- **Deviation from plan:** the view mirror is now `public/src/views/FrameworkView.vue` — "Beats and ceremonies", which renders the data rule; no separate "Beats" view section was added.
|
||||
- **Resolved position:** a commitment already made outside the team is renegotiated by whoever made it, the Enabler helps, and the team hears about it before the next beat starts.
|
||||
- **Disposition:** reworded — "A commitment made outside the team is renegotiated by whoever made it, with the Enabler helping, and the team hears about it before the next beat starts." The site mirror changed in the same pass: `public/src/views/FrameworkView.vue` no longer renders the "Beats" section, whose text "We work in beats—flexible iterations of one to two weeks." gave the beat length without the source of truth; the page now renders "Beats and ceremonies", and the beat length is stated in `README.md` — "Beats" and in `manifesto.js` — `ceremonies`.
|
||||
|
||||
### WP-41 — "Disputes resolve async, then sync if stuck" has no timeout or fallback decider
|
||||
|
||||
- **Location:** `README.md` — "Prioritization"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "The Enabler sets the stack. Makers may adjust with reason. Disputes resolve async, then sync if stuck."
|
||||
- **Why:** "Stuck" has no time limit, no fallback decider is named for a dispute the Enabler cannot settle, and the Enabler is not excluded from being a party to the dispute.
|
||||
- **Resolution made:** `README.md` — "Prioritization" now gives the timeout, the fallback and the recusal: "If nobody answers within 24 working hours — a BEAT default, not a research finding — the dispute goes to a short synchronous discussion, and the Enabler decides unless they are a party to it, in which case the team decides."; mirrored in `public/src/data/manifesto.js` — `roles[1].description` ("When they are a party to a dispute, they step out of it."), `priorityBuckets` and `decisionRules` — "Decisions" ("Nobody objects within 24 working hours — a BEAT default, not a research finding — and the decision is recorded."). The README side of the repair is now complete: card `77cc3e22` changed the "Prioritization" timeout to the data wording, so `README.md` and the data side state the same wait.
|
||||
- **Deviation from plan:** the data stated the wait as "24 working hours" while `README.md` said "one working day"; the same wording difference as WP-31. The README text was outside this card's file, so the README repair landed on card `77cc3e22`, which changed the sentence to "If nobody answers within 24 working hours — a BEAT default, not a research finding — the dispute goes to a short synchronous discussion, and the Enabler decides unless they are a party to it, in which case the team decides." The difference is closed.
|
||||
- **Resolved position:** a dispute waits 24 working hours for an answer, then goes to a short synchronous discussion; the Enabler decides unless they are a party to it, in which case the team decides.
|
||||
- **Disposition:** reworded — "If nobody answers within 24 working hours — a BEAT default, not a research finding — the dispute goes to a short synchronous discussion, and the Enabler decides unless they are a party to it, in which case the team decides."
|
||||
|
||||
### WP-42 — Two of the six done criteria are conditional, so "done" is not decidable
|
||||
|
||||
- **Location:** `README.md` — "Definition of Done"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "Tests pass (existing and new where appropriate)" and "Deployable (or deployed, depending on team practice)" and "**The team owns this definition.** Adjust it as needed. But once agreed, honor it."
|
||||
- **Why:** Two of the six criteria are conditional on team practice, the list has no owner for the "where appropriate" judgement, and no rule says what a maker does when a done condition cannot be met — while the section insists "Done" means done.
|
||||
- **Resolution made:** `README.md` — "Definition of Done" now makes each criterion decidable and names who decides the conditional parts: "Tests pass: the existing suite passes, and new behaviour carries a test unless the team has agreed an exception for it, which the Enabler records"; "Code reviewed by at least one other maker, or auto-proceeded under the review rule with the exceptions in that rule named in the merge"; "Deployable: the artefact builds and runs for the team's own use, and is deployed where the team deploys its own work"; "No known defects introduced: a defect found during the work and logged as its own item does not block this one, provided it is recorded before the merge"; "If a maker cannot meet a condition, they raise it before the work starts; the team either changes the condition or the work does not start."; mirrored in `public/src/data/manifesto.js` — `definitionOfDone.code` and `decisionRules` — "Done condition".
|
||||
- **Deviation from plan:** the view mirror `public/src/views/ReferenceView.vue` — "Definition of Done (Code)" exists as "Definition of done"; there is no separate code-only block in the view at the branch head.
|
||||
- **Resolved position:** each criterion states its exception and who records it, the Enabler records an agreed test exception, and a condition that cannot be met is raised before the work starts, where the team changes the condition or the work does not start.
|
||||
- **Disposition:** reworded — "If a maker cannot meet a condition, they raise it before the work starts; the team either changes the condition or the work does not start."
|
||||
|
||||
### WP-43 — The optional technical practices block has no applicability statement
|
||||
|
||||
- **Location:** `README.md` — "Technical Practices (Optional)"
|
||||
- **Category:** rule not applicable as written
|
||||
- **Original wording:** "These are not mandated. They are offered as practices that support focus, speed, and quality. Adopt what serves you. Discard what doesn't."
|
||||
- **Why:** The block names no scope (whole team, one service, one repository), no decision owner, and no rule for a practice that is only partly applicable — for example mandatory automated testing with a legacy codebase that has no test harness.
|
||||
- **Resolution made:** `README.md` — "Technical Practices (Optional)" now states the scope, the owner and the partial-adoption rule: "BEAT does not prescribe technical practices. These apply to one repository or service, adopted by the team that owns it. The team that owns the code decides. A practice that only partly applies … is adopted in the part that applies …"; mirrored in `public/src/data/manifesto.js` — `technicalPractices` and `practicePolicy` (scope, decidedBy, partialAdoption), rendered by `public/src/views/PracticesView.vue` — "Technical practices".
|
||||
- **Resolved position:** the practices apply to one repository or service, the team that owns the code decides, and a practice that only partly applies is adopted in the part that applies.
|
||||
- **Disposition:** reworded — "BEAT does not prescribe technical practices. These apply to one repository or service, adopted by the team that owns it. The team that owns the code decides." The same figure in `README.md` — "Technical Practices (Optional)" and in `public/src/data/manifesto.js` — `technicalPractices[1].description` was reworded: "Aim for PRs a reviewer can read in one sitting — a BEAT default, not a measured threshold." replaces "Aim for PRs reviewable in under 30 minutes."; `public/src/views/AntiPatternsView.vue` no longer renders the "The Fix" column of the anti-pattern tables, whose cells were BEAT's own rules with no source.
|
||||
|
||||
---
|
||||
|
||||
## Uncovered situation
|
||||
|
||||
### WP-44 — Incidents and on-call: the incident is covered, the rotation is not
|
||||
|
||||
- **Location:** `README.md` — missing section (the "Incidents & Emergencies" section covers the incident only)
|
||||
- **Category:** uncovered situation
|
||||
- **Original wording:** "**During incidents:**" and "Sacred blocks are suspended" and "Whoever is available helps—no \"not my job\"" and "**This is not normal work.** Incidents should be rare. If they're frequent, that's a systemic problem to solve—not a reason to abandon sustainable pace."
|
||||
- **Why:** Nothing defines who is on call, how the rotation is set, how it is handed over across time zones, whether on-call work is counted inside or outside a beat, how it is compensated, or how "available" is defined when Principle 6 says "Everything else waits" and Principle 10 makes overtime a red flag. "Whoever is available" is the only availability rule, and it depends on availability never being defined. A search of `public/src/data` and `public/src/views` finds no mention of on-call, a rotation, a handover or compensation.
|
||||
- **Resolution made:** `README.md` — new "The Framework" → "On-call and Incident Rotation" (anchor `onCall`) covers Rotation, Handover, Availability, Who may declare an incident, Inside or outside the beat, Compensation and Escalation; mirrored in `public/src/data/manifesto.js` — new `onCall` key, rendered by `public/src/views/PracticesView.vue` in the situations block (`const situations = [onCall, timeZones, crossTeamDependencies, measurement, customerFeedback]`).
|
||||
- **Disposition:** added — the section "On-call and Incident Rotation" and the `onCall` data key, neither of which existed before.
|
||||
|
||||
### WP-45 — Time zones: named as a benefit, never as a condition
|
||||
|
||||
- **Location:** `README.md` — missing section (time zones appear only as an argument for writing)
|
||||
- **Category:** uncovered situation
|
||||
- **Original wording:** "Written words can be searched, referenced, and shared across time zones."
|
||||
- **Why:** The manifesto calls itself remote-first and lists "Remote-first or distributed teams" as a best fit, yet never states coverage hours, what "24 working hours" means across zones, how the daily check-in works for a maker whose day has barely started, how one maker's sacred block lands on another maker's working day, how a 30-minute Beat Start is attended across zones, or how handover happens. Every time-dependent rule in the text — sacred blocks, 24 working hours, 4-hour review SLA, 24-hour auto-proceed, 5-day staleness, daily merges — assumes a single working day that does not exist for a distributed team.
|
||||
- **Resolution made:** `README.md` — new "The Framework" → "Working across Time Zones" (anchor `timeZones`) states "Every rule in BEAT that counts time runs on the team's stated coverage hours, in working hours. Here is the reference time zone those hours are counted in." with Coverage hours, Reference time zone, Overlap hours, Handover, Daily check-in, Sacred blocks and Urgent work across zones; mirrored in `public/src/data/manifesto.js` — new `timeZones` key, rendered by `public/src/views/PracticesView.vue` in the situations block.
|
||||
- **Disposition:** added — the section "Working across Time Zones" and the `timeZones` data key, neither of which existed before.
|
||||
|
||||
### WP-46 — Onboarding: a four-week ramp with no escalation path
|
||||
|
||||
- **Location:** `README.md` — "Onboarding to BEAT" (gaps within an existing section)
|
||||
- **Category:** uncovered situation
|
||||
- **Original wording:** "### Week One: Observe", "- Expect full productivity in week one" and "New member has a \"buddy\" for questions (informal, not mandatory pairing)"
|
||||
- **Why:** The section lists what happens week by week but not what happens when the ramp fails: no named artefact set a new member must read (decision log, architecture notes, the board's own history), no treatment of a new member's first review against the four-hour review SLA and the 24-hour auto-proceed rule, no statement of what a new member may decline, and no reconciliation with the "Junior-heavy teams needing close guidance" entry in "BEAT fits poorly for:" — the only guidance a junior receives is this ramp. No time-zone note applies to week one either, since the 1:1s may be asynchronous.
|
||||
- **Resolution made:** `README.md` — "Onboarding to BEAT" gained four subsections: "Reading List", "Your First Review", "When the Ramp Is Not Working" (which states "You may decline work, meetings and on-call during the ramp") and "On Junior-Heavy Teams"; mirrored in `public/src/data/manifesto.js` — `onboarding` (`readingList`, `firstReview`, `escalationPath`, `juniorTeams`), rendered by `public/src/views/OnboardingView.vue`.
|
||||
- **Deviation from plan:** the planned `public/src/views/PracticesView.vue` — "Collaboration" mirror was not created; the escalation path, reading list, first review and junior-team rules live in `README.md` — "Onboarding to BEAT", in `manifesto.js` — `onboarding`, and in `OnboardingView.vue`.
|
||||
- **Disposition:** added — the four new "Onboarding to BEAT" subsections and the four new `onboarding` keys.
|
||||
|
||||
### WP-47 — Cross-team dependencies: everything stops at the team boundary
|
||||
|
||||
- **Location:** `README.md` — missing section
|
||||
- **Category:** uncovered situation
|
||||
- **Original wording:** "**Blockers:** Surface in check-in. Pull different work while waiting. Enabler escalates." and "**The Connector** maintains knowledge flow. They keep documentation current, ensure context flows between makers, and onboard new members." and "**Define interfaces first.** Agree on contracts. Work in parallel against them."
|
||||
- **Why:** All escalation, all connectors and all interface agreement are intra-team. Nothing covers a dependency owned by another team, a pull-based team with no inbound queue, a shared library or platform change that blocks several teams, or how a commitment made to another team is tracked. "Enabler escalates" names no target of the escalation.
|
||||
- **Resolution made:** `README.md` — new "The Framework" → "Dependencies across Teams" (anchor `crossTeamDependencies`) covers Naming the dependency, Raising it, Interfaces, Commitments to other teams, Shared foundations and When the other side does not answer; mirrored in `public/src/data/manifesto.js` — new `crossTeamDependencies` key, rendered by `public/src/views/PracticesView.vue` in the situations block.
|
||||
- **Disposition:** added — the section "Dependencies across Teams" and the `crossTeamDependencies` data key, neither of which existed before. The site mirror changed in the same pass, and that removal is recorded here: `public/src/views/PracticesView.vue` — "Multi-Maker Work" — no longer renders that section or its four cards, "Break vertically", "Define interfaces first", "Coordinate via doc" and "Sync only when stuck"; each of them was removed, because the cards stated BEAT's own rules with no scope or owner. The wording that stays is in `README.md` — "Multi-Maker Work" — "Large features require coordination without ceremony:" with "**Break vertically.** Each maker owns an end-to-end slice, not a horizontal layer. Slices ship independently.", "**Define interfaces first.** Agree on contracts. Work in parallel against them. Mock until real.", "**Coordinate via doc.** One feature doc serves as source of truth. Makers claim slices, flag blockers, log decisions. Update async." and "**Sync only when stuck.** When async fails, meet briefly. Document outcome. Return to async."
|
||||
|
||||
### WP-48 — Accountability and measurement: outcomes are promised but never defined
|
||||
|
||||
- **Location:** `README.md` — missing section (measurement is asserted in Principle 3 and the anti-pattern table, never specified)
|
||||
- **Category:** uncovered situation
|
||||
- **Original wording:** "We do not measure hours worked or time online. We measure outcomes delivered." and "| **Metric theater** | Tracking velocity, points, hours | Stop. Measure outcomes, not activity. |" and "- Burnout despite 80% planning"
|
||||
- **Why:** No section states what is measured, by whom, over what window, or what happens where outcomes are not observable — support, infrastructure, research, maintenance. "Outcomes" is never defined. The anti-pattern forbids activity metrics without saying what replaces them. The warning sign "Burnout despite 80% planning" has no threshold that triggers the response it implies, and the response it names is "Discuss in Beat Close". The site's assessment instrument is a self-report with no statement of validity, so it cannot serve as the measurement mechanism either.
|
||||
- **Resolution made:** `README.md` — new "The Framework" → "Accountability and Measurement" (anchor `measurement`) states "What is measured.", "Who measures.", "When.", "Window.", "**Warning signs and their thresholds.**" (overtime at the limit in two consecutive beats, WIP at the limit in two consecutive beats, the same blocker unresolved across two beats, a maker who has missed two check-ins in a row), "Not a scorecard.", "When an outcome is not observable." and "**The assessment on this site.**"; mirrored in `public/src/data/manifesto.js` — new `measurement` key, rendered by `public/src/views/PracticesView.vue` in the situations block, plus the validity note in `public/src/data/assessment.js` — `overallAssessment.validity.note` ("This is a self-report with no published validity evidence.").
|
||||
- **Deviation from plan:** the four warning-sign thresholds sit in "Accountability and Measurement" → "Warning signs and their thresholds"; the "Anti-Patterns" → "When BEAT Isn't Working" list now carries the same four thresholds.
|
||||
- **Disposition:** added — the section "Accountability and Measurement", the `measurement` data key and the assessment validity note. The removals that came with it are recorded here: `public/src/views/AntiPatternsView.vue` — "When BEAT Isn't Working" — no longer renders that heading or the warning-sign list, so the heading "When BEAT Isn't Working" and the warning sign "Burnout despite 80% planning" were both removed, the figure because no threshold stood behind it. The same bullet "- Burnout despite 80% planning" was removed from `README.md` — "Anti-Patterns" → "When BEAT Isn't Working", and the response that followed it was reworded, not removed: "**Response:** Each of these is discussed at the next beat close, with the response written down there, and the plan is changed where it is the plan that failed. BEAT is a tool, not a religion. If it's not working, change it or choose something else." replaces "**Response:** Discuss in Beat Close. Adapt the framework. BEAT is a tool, not a religion. If it's not working, change it or choose something else." The wording that replaces them carries the thresholds: `README.md` — "When BEAT Isn't Working" — "Signs the methodology isn't serving the team:" with "Overtime in two consecutive beats", "WIP at the limit in two consecutive beats", "The same blocker unresolved across two beats" and "A maker who has missed two check-ins in a row", and `public/src/data/manifesto.js` — `measurement` — "Warning signs and their thresholds" — "Overtime in two consecutive beats, or WIP at the limit in two consecutive beats, or the same blocker unresolved across two beats, or a maker who has missed two check-ins in a row. Each one is discussed at the next beat close, and the response is written down there."
|
||||
|
||||
---
|
||||
|
||||
## Consistency gaps between README.md and the site
|
||||
|
||||
### WP-49 — The site commitment list is missing one of the five commitments
|
||||
|
||||
- **Location:** `README.md` — "The BEAT Commitment" against `public/src/views/HomeView.vue` — `commitments`
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "**Improving always** — We will reflect each beat. We will adjust. We will find better ways." against a `commitments` array with four entries: "Protecting focus", "Defaulting to async", "Trusting makers", "Sustaining pace"
|
||||
- **Why:** The site states a different commitment set from the README it claims to publish.
|
||||
- **Resolution made:** `public/src/views/HomeView.vue` — `commitments` now carries all five commitments (Protecting focus, Defaulting to async, Trusting makers, Sustaining pace, Improving always), matching `README.md` — "The BEAT Commitment" (which ends "**Improving always** — We will reflect each beat. We will adjust. We will find better ways.").
|
||||
- **Deviation from plan:** the fifth commitment was added in the view, as planned, but the list stayed local to `public/src/views/HomeView.vue`; no `commitments` key was added to `public/src/data`, so the README and the site still carry the list in two places.
|
||||
- **Resolved position:** the site now publishes the same five commitments as the README.
|
||||
- **Disposition:** added — the fifth commitment "Improving always" is now present in the site's list, so the site publishes the same five commitments as the README.
|
||||
|
||||
### WP-50 — "Customer & User Feedback" has no site counterpart at all
|
||||
|
||||
- **Location:** `README.md` — "Customer & User Feedback" against the absence of any matching site content
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "**Direct access.** Makers should have direct access to user feedback—support tickets, analytics, user interviews. Not filtered through three layers of management." and "**Regular exposure.** At least once per beat, someone on the team reviews real user feedback. Share highlights async."
|
||||
- **Why:** A search of `public/src/data` and `public/src/views` finds no section, data key or view carrying this content, so the site and the README do not carry the same set of sections.
|
||||
- **Resolution made:** `public/src/data/manifesto.js` — new `customerFeedback` key (id, title "Customer & User Feedback", summary "Work built away from users drifts away from what users need. We keep the line to users open.", appliesTo, decidedBy, ifItDoesNotFit and items), rendered by `public/src/views/PracticesView.vue` in the situations block; `README.md` — "Customer & User Feedback" stays as the source text.
|
||||
- **Deviation from plan:** the site carries the section inside the practices situations list rather than as a standalone route section, and `customerFeedback` is a sixth situation block alongside the five the plan named.
|
||||
- **Resolved position:** the site now carries the "Customer & User Feedback" content that previously existed only in the README.
|
||||
- **Disposition:** added — the `customerFeedback` data key and its rendering in `PracticesView.vue`.
|
||||
|
||||
### WP-51 — The assessment exists on the site with no README counterpart
|
||||
|
||||
- **Location:** `public/src/views/AssessmentView.vue` and `public/src/data/assessment.js` against `README.md` — missing section
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "export const assessmentQuestions = [", "export const overallAssessment = {", "{{ totalScore }} / 48"
|
||||
- **Why:** The site publishes a full route (`/assessment`) with 12 scored questions, four categories, per-category recommendations and four overall bands; the README has no assessment section and its "Appendix: Quick Reference" has no assessment block, so the two sides do not carry the same set of sections.
|
||||
- **Resolution made:** `README.md` — new "The Self-Assessment" (anchor `assessment-scoring`) and its validity paragraph (anchor `assessment-validity`), plus the appendix block "The Self-Assessment", now describe the twelve scored questions, the four categories, the 0–4 points per question, the 48-point maximum, the category bands (low below 40% of a category maximum, medium 40–70%, high above 70%), the overall bands (low 12 to 24, medium 25 to 36, strong 37 to 42, high 43 to 48) and the statement that the assessment is a self-report with no published validity evidence; mirrored in `public/src/data/assessment.js` — `overallAssessment.scoring` and `overallAssessment.validity`, with the site route unchanged. The README side of the repair is now complete: card `776499a9` changed the scoring paragraph in `README.md` — "The Self-Assessment" (line 698) to "The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, and high 43 to 48.", so both mirrors now state the same position.
|
||||
- **Deviation from plan:** the README scoring paragraph said "The same two cuts give the four overall bands", while the data said the bands are "a separate BEAT choice … not produced by those two percentage cuts". The README wording was outside this card's file, so the README repair landed on card `776499a9`, which changed the sentence to the data wording. The difference is closed.
|
||||
- **Resolved position:** both sides now describe the same instrument — twelve scored questions, four categories, 48 points maximum, one category rule and one band list — and both state that it is a self-report with no published validity evidence. On the derivation, both sides now say the same thing: the four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by the two percentage cuts.
|
||||
- **Disposition:** added — the README sections "The Self-Assessment" and the appendix assessment block. The assessment copy was reworded in the same pass. The README scoring paragraph was reworded on card `776499a9`: `README.md` — "The Self-Assessment" now reads "The thresholds are BEAT's own scoring rule, not a research finding: a category is low below 40 percent of its maximum, medium from 40 to 70 percent, and high above 70 percent. The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, and high 43 to 48." In `public/src/data/assessment.js` — `overallAssessment.struggling.description`: "Your team faces significant challenges that BEAT is designed to address. The good news: there is room for real improvement here." replaces "Your team faces significant challenges that BEAT is designed to solve. The good news: there's tremendous potential for improvement."; `overallAssessment.developing.description`: "BEAT can provide the structure to build on them." replaces "BEAT can provide the structure to level up."; `overallAssessment.excellent.description`: "Your team is already aligned with BEAT principles. Consider adopting the framework formally." replaces "Congratulations! Your team is already aligned with BEAT principles. Consider adopting the framework formally."; `overallAssessment.excellent.callToAction`: "You're ready to adopt BEAT fully and to teach these practices to others." replaces "You're ready to fully adopt BEAT and become ambassadors for these practices." In `public/src/views/AssessmentView.vue` the hero subtitle "Discover how BEAT can help your team deliver better and faster." and the intro paragraph "Answer 12 quick questions about your current practices. We'll analyze your responses and show you specifically how BEAT principles can help your team." were removed, and the teaser row "3-5 min", "Anonymous" and "Instant results" was removed with them; the hero now reads "Answer a short set of questions about how your team works. Score what your team does now, not what it intends to do." and the progress line reads "Answered so far: ${answeredCount}." instead of "Answered ${answeredCount} of ${assessmentQuestions.length}."
|
||||
|
||||
### WP-52 — Three board rules exist only in the README prose and one view
|
||||
|
||||
- **Location:** `README.md` — "The Board" against `public/src/data/manifesto.js` — `constraints`
|
||||
- **Category:** self-contradiction
|
||||
- **Original wording:** "Work-in-progress limit: three per maker. NEXT is ordered. NOW pins to top. Items stale for five days return to backlog." against a `constraints` array holding nine entries and none of them being "NOW pins to top" or "Items stale for five days return to backlog"
|
||||
- **Why:** The board rules live in README prose and in `public/src/views/FrameworkView.vue` ("WIP Limit", "Stale Items"), but the shared `constraints` structure that feeds "The Numbers" on both the framework page and the reference page carries neither the pinning rule nor the staleness rule, and the "We do not groom" rule has no entry there at all. The mapping a reader of either side builds is therefore different from the other.
|
||||
- **Resolution made:** `public/src/data/manifesto.js` — the missing board rules are now shared data in `decisionRules` — "Work-in-progress limit", "Stale-item sweep", "NOW bucket limit" and "Sizing", each with appliesTo, decidedBy and ifItDoesNotFit; `constraints` carries the nine numeric limits that feed "The Numbers" on both the framework and the reference page, including "WIP per maker | 3 items", "NOW items | Max 5" and "Planning capacity | 80% of available working time".
|
||||
- **Deviation from plan:** the board rules landed in `decisionRules` (fourteen rules), not in `constraints` as planned, and the planned `public/src/views/FrameworkView.vue` — "WIP Limit" and "Stale Items" sections do not exist at the branch head; the view now renders "Planning numbers" and "Decision rules".
|
||||
- **Resolved position:** the WIP limit, the stale-item sweep, the NOW bucket limit and the sizing rule are the same rules on both sides, carried once in the shared data.
|
||||
- **Disposition:** added — the `decisionRules` — "Work-in-progress limit", "Stale-item sweep", "NOW bucket limit" and "Sizing" rules.
|
||||
|
||||
---
|
||||
|
||||
## Uncited claims and figures
|
||||
|
||||
Every research claim and every figure in `README.md`, `public/src/data` and `public/src/views` that currently carries no citation, one line each. "Expect" states the planned disposition. Claims that are BEAT's own rules rather than research are marked as such — they still need an explicit source-of-truth statement (WP-05) or a citation.
|
||||
|
||||
### README.md — research claims
|
||||
|
||||
- `README.md` — "What We Have Learned": "BEAT emerges from research on how developers actually work:" — framing of the whole list as research; expect reword.
|
||||
- `README.md` — "What We Have Learned": "Developers trend toward introversion and need low-stimulation focus time" — uncited; expect reword as a BEAT premise.
|
||||
- `README.md` — "What We Have Learned": "Deep focus requires 52 minutes to reach and 23 minutes to recover from interruption" — uncited and wrong source; expect reword.
|
||||
- `README.md` — "What We Have Learned": "More than two meetings per day reduces productive output to 14%" — uncited, no such finding; expect removal.
|
||||
- `README.md` — "What We Have Learned": "Peak cognitive work capacity is approximately four hours per day" — uncited, wrong number; expect reword.
|
||||
- `README.md` — "What We Have Learned": "72% of meetings are ineffective at their stated purpose" — uncited, wrong number; expect reword to the sourced figure.
|
||||
- `README.md` — "What We Have Learned": "Autonomy, competence, and relatedness drive intrinsic motivation" — uncited; expect citation to Self-Determination Theory.
|
||||
- `README.md` — Principle 1: "The uninterrupted mind produces the best work." — uncited claim.
|
||||
- `README.md` — Principle 1: "We maintain sacred blocks of four hours daily" — BEAT's own figure.
|
||||
- `README.md` — Principle 2: "Research shows 52 minutes to reach deep focus, 23 minutes to recover from interruption." — uncited and wrong source.
|
||||
- `README.md` — Principle 2: "Every \"quick question\" costs more than it appears." — uncited claim, the closing sentence of the same research paragraph; expect citation or reword as a BEAT rule.
|
||||
- `README.md` — Principle 3: "A maker in focus for four hours outproduces a maker in meetings for eight." — uncited quantitative claim.
|
||||
- `README.md` — Principle 5: "We limit them to two hours per week, one hour maximum each." — BEAT's own figures.
|
||||
- `README.md` — Principle 6: "We expect responses within 24 working hours." — BEAT's own figure; "24 working hours" is undefined (see WP-31).
|
||||
- `README.md` — Principle 10: "Burnout destroys teams. Recovery is productive." — uncited claim.
|
||||
- `README.md` — Principle 10: "We plan at 80% and leave slack for life." — BEAT's own figure.
|
||||
- `README.md` — Principle 11: "Someone must watch for warning signs: maxed WIP, skipped check-ins, overtime patterns, withdrawal." — BEAT's own warning-sign list, unsourced; the thresholds are undefined (see WP-48).
|
||||
- `README.md` — Principle 11: "Someone must shield the team from organizational noise. Someone must say \"no\" to protect \"yes.\"" — BEAT's own rule; no owner or escalation path stated.
|
||||
- `README.md` — Principle 12: "Twenty percent of time belongs to the maker for learning, tooling, experiments, and interests." — BEAT's own figure.
|
||||
- `README.md` — "Customer & User Feedback": "Building in isolation produces irrelevant software." — uncited claim.
|
||||
- `README.md` — "Where BEAT Fits": "BEAT works best for:" and its six items ("Remote-first or distributed teams", "Senior and mid-level developers", "Product companies", "Teams of 3-8 people", "High-trust environments", "Async-native cultures") — uncited effectiveness claims.
|
||||
- `README.md` — "Where BEAT Fits": "BEAT fits poorly for:" and its four items ("Junior-heavy teams needing close guidance", "Regulated industries requiring ceremony", "Agency work with constant client sync", "Organizations unwilling to protect focus time") — uncited effectiveness claims.
|
||||
- `README.md` — "Where BEAT Fits": "BEAT can adapt for:" and its three items ("Incident response (see Incidents section)", "Mixed seniority (extra onboarding support)", "Larger teams (multiple BEAT teams with coordination layer)") — uncited claims.
|
||||
- `README.md` — "Where BEAT Fits": "Teams of 3-8 people" — unsourced figure.
|
||||
|
||||
### README.md — figures and rules presented as limits
|
||||
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| Sacred block | 4 hours daily |" — BEAT's own limit, no derivation stated.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| Meetings per week | ≤2 hours total |" — BEAT's own limit.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| Meeting duration | ≤1 hour each |" — BEAT's own limit.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| WIP per maker | 3 items |" — BEAT's own limit.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| Planning capacity | 80% |" — BEAT's own limit.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| Exploration time | 20% (1 day/beat) |" — BEAT's own limit; internally inconsistent.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| NOW items | Max 3-5 |" — BEAT's own limit; conflicts with "Maximum five items".
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| Review response | 4 hours |" — BEAT's own limit.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Numbers": "| Auto-proceed | 24 hours |" — BEAT's own limit.
|
||||
- `README.md` — "Prioritization": "**NOW** — Critical, blocking, time-sensitive. Maximum five items." — uncited figure; conflicts with the appendix.
|
||||
- `README.md` — "The Board": "Work-in-progress limit: three per maker." — BEAT's own figure.
|
||||
- `README.md` — "The Board": "Items stale for five days return to backlog." — BEAT's own figure.
|
||||
- `README.md` — "The Board": "NOW pins to top." — BEAT's own rule.
|
||||
- `README.md` — "Avoiding Chokepoints": "**Reviews:** Anyone can review. Four-hour response SLA. Auto-proceed after 24 hours if CI passes." — BEAT's own figures.
|
||||
- `README.md` — "Avoiding Chokepoints": "**Merges:** Merge main daily." — BEAT's own rule.
|
||||
- `README.md` — "Avoiding Chokepoints": "**Decisions:** Post recommendation. Wait 24 hours." — BEAT's own figure.
|
||||
- `README.md` — "Incidents & Emergencies": "Someone claims ownership within 15 minutes." — BEAT's own figure.
|
||||
- `README.md` — "Incidents & Emergencies": "Brief status updates every 30 minutes until resolved." — BEAT's own figure.
|
||||
- `README.md` — "Incidents & Emergencies": "Async post-mortem within 48 hours." — BEAT's own figure.
|
||||
- `README.md` — "Incidents & Emergencies": the four incident-qualification bullets ("Users cannot complete critical actions", "Data integrity is at risk", "Security vulnerability is being exploited", "Significant revenue or reputation impact") — uncited criteria.
|
||||
- `README.md` — "Meetings": "**Two hours per week** total" and "**One hour maximum** per meeting" — BEAT's own figures.
|
||||
- `README.md` — "Meetings": "**Beat Start** (30 min)", "**Beat Close** (30 min)", "**Ad-hoc Help** (≤25 min)", "**Brainstorm** (≤1 hr)" — BEAT's own figures.
|
||||
- `README.md` — "Meetings": "with 10-minute exit window" — BEAT's own figure.
|
||||
- `README.md` — "Burnout Prevention": "**Plan at 80%.**" — unsourced figure.
|
||||
- `README.md` — "Burnout Prevention": "**Protect exploration time.** One day per beat." — unsourced figure.
|
||||
- `README.md` — "Beats": "We work in **beats**—flexible iterations of one to two weeks." — BEAT's own definition; the length drives the "20% (1 day/beat)" figure.
|
||||
- `README.md` — "Work Items": "**Tasks** (hours)", "**Work Items** (days)", "**Projects** (week+)" and "We size with **S/M/L**, not story points." — BEAT's own sizing bands, unsourced.
|
||||
- `README.md` — "Daily Check-in": "Post once daily, when convenient. Two minutes." — BEAT's own figures.
|
||||
- `README.md` — "Anti-Patterns" → "Organizational Anti-Patterns": "| **Stealth deadlines** | Surprise \"we promised client by Friday\" | Surface commitments before making them |" — the Friday deadline is illustrative, the rule is BEAT's own.
|
||||
- `README.md` — "Anti-Patterns" → "Process Anti-Patterns": "| **Permanent NOW** | Everything is urgent, always | If everything is NOW, nothing is |" — uncited claim.
|
||||
- `README.md` — "Technical Practices (Optional)": "Aim for PRs reviewable in under 30 minutes." — BEAT's own figure.
|
||||
- `README.md` — "Onboarding to BEAT": the Week One / Week Two / Week Three ramp and the "First Month Expectations" list — BEAT's own rules, unsourced.
|
||||
- `README.md` — "Spotted Issues": "**Five minutes or less?**" and "**More than five minutes, not blocking?**" — BEAT's own figures.
|
||||
- `README.md` — "Customer & User Feedback": "**Regular exposure.** At least once per beat" — BEAT's own figure.
|
||||
- `README.md` — "Appendix: Quick Reference" → "The Ceremonies": "Beat Start | 30 min", "Beat Close | 30 min", "Ad-hoc Help | ≤25 min", "Brainstorm | ≤1 hr" — BEAT's own figures.
|
||||
- `README.md` — "Appendix: Quick Reference" → "Incident Protocol": "Acknowledge (15 min)", "Communicate (every 30 min)", "Document (within 48 hrs)" — BEAT's own figures.
|
||||
- `README.md` — "Appendix: Quick Reference" → "Spotted Issue Decision": "≤5 min?" and ">5 min?" — BEAT's own figures.
|
||||
|
||||
### public/src/data/manifesto.js
|
||||
|
||||
- `manifesto.js` — `researchStats[0]`: "52 minutes" / "to reach deep focus" — uncited and wrong source.
|
||||
- `manifesto.js` — `researchStats[1]`: "23 minutes" / "to recover from interruption" — uncited and false precision.
|
||||
- `manifesto.js` — `researchStats[2]`: "14%" / "productive output with 2+ meetings/day" — uncited, no such finding; expect removal.
|
||||
- `manifesto.js` — `researchStats[3]`: "4 hours" / "peak cognitive work capacity daily" — uncited and wrong number.
|
||||
- `manifesto.js` — `researchStats[4]`: "72%" / "of meetings are ineffective" — uncited and wrong number.
|
||||
- `manifesto.js` — `principles.focus[0].description`: "The uninterrupted mind produces the best work." — uncited claim.
|
||||
- `manifesto.js` — `principles.focus[0].description`: "sacred blocks of four hours daily" — BEAT's own figure.
|
||||
- `manifesto.js` — `principles.focus[1].description`: "Research shows 52 minutes to reach deep focus, 23 minutes to recover from interruption." — uncited and wrong source.
|
||||
- `manifesto.js` — `principles.focus[1].description`: "Every \"quick question\" costs more than it appears." — uncited claim, the closing sentence of the same research paragraph; expect citation or reword as a BEAT rule.
|
||||
- `manifesto.js` — `principles.focus[2].description`: "A maker in focus for four hours outproduces a maker in meetings for eight." — uncited quantitative claim.
|
||||
- `manifesto.js` — `principles.communication[0].description`: "Decisions not documented did not happen." — uncited claim.
|
||||
- `manifesto.js` — `principles.communication[1].description`: "two hours per week, one hour maximum each" — BEAT's own figures.
|
||||
- `manifesto.js` — `principles.communication[2].description`: "responses within 24 working hours" — BEAT's own figure.
|
||||
- `manifesto.js` — `principles.communication[2].description`: "Urgent means phone call." — BEAT's own rule.
|
||||
- `manifesto.js` — `principles.sustainability[0].description`: "Burnout destroys teams. Recovery is productive." — uncited claim.
|
||||
- `manifesto.js` — `principles.sustainability[0].description`: "We plan at 80% and leave slack for life." — unsourced figure.
|
||||
- `manifesto.js` — `principles.sustainability[2].description`: "Twenty percent of time belongs to the maker" — unsourced figure.
|
||||
- `manifesto.js` — `constraints`: all nine entries ("4 hours daily", "≤2 hours total", "≤1 hour each", "3 items", "80%", "20% (1 day/beat)", "Max 3-5", "4 hours", "24 hours") — uncited figures.
|
||||
- `manifesto.js` — `priorityBuckets[0].description`: "Maximum five items." — uncited figure; conflicts with `constraints` "Max 3-5".
|
||||
- `manifesto.js` — `ceremonies`: "30 min", "30 min", "≤25 min", "≤1 hr" and "with 10-minute exit window" — BEAT's own figures.
|
||||
- `manifesto.js` — `definitionOfDone.code`: "Tests pass (existing and new where appropriate)" and "Deployable (or deployed, depending on team practice)" — conditional criteria, no source.
|
||||
- `manifesto.js` — `incidentProtocol[1].description`: "Someone claims ownership within 15 minutes." — BEAT's own figure.
|
||||
- `manifesto.js` — `incidentProtocol[2].description`: "Brief status updates every 30 minutes until resolved." — BEAT's own figure.
|
||||
- `manifesto.js` — `incidentProtocol[4].description`: "Async post-mortem within 48 hours." — BEAT's own figure.
|
||||
- `manifesto.js` — `technicalPractices[1].description`: "Aim for PRs reviewable in under 30 minutes." — BEAT's own figure.
|
||||
- `manifesto.js` — `whereItFits.worksFor`: all six suitability claims — uncited.
|
||||
- `manifesto.js` — `whereItFits.fitsPoorly`: all four suitability claims — uncited.
|
||||
- `manifesto.js` — `whereItFits.canAdapt`: all three suitability claims — uncited.
|
||||
- `manifesto.js` — `onboarding.weekOne.items[4]`: "Meet team members 1:1 (async or sync, their preference)" — BEAT's own rule.
|
||||
- `manifesto.js` — `antiPatterns.organizational[1]`: "Surface commitments before making them" — BEAT's own rule.
|
||||
- `manifesto.js` — `antiPatterns.process[3]`: "If everything is NOW, nothing is" — uncited claim.
|
||||
- `manifesto.js` — `antiPatterns.people[3].fix`: "Anyone can review, auto-proceed rule" — BEAT's own rule.
|
||||
|
||||
### public/src/data/assessment.js
|
||||
|
||||
- `assessment.js` — `beatRecommendations.focus.low.description`: "Research shows it takes 52 minutes to reach focus and 23 minutes to recover from interruption." — uncited and wrong source.
|
||||
- `assessment.js` — `beatRecommendations.focus.low.recommendations[0]`: "Establish 4-hour daily sacred blocks" — BEAT's own figure.
|
||||
- `assessment.js` — `beatRecommendations.focus.low.recommendations[1]`: "Limit meetings to 2 hours per week maximum" — BEAT's own figure.
|
||||
- `assessment.js` — `beatRecommendations.focus.medium.recommendations[1]`: "Audit your meeting calendar - can 50% become async?" — unsourced figure.
|
||||
- `assessment.js` — `beatRecommendations.focus.low.beatPrinciple`: "The uninterrupted mind produces the best work." — uncited claim.
|
||||
- `assessment.js` — `beatRecommendations.focus.medium.beatPrinciple`: "A maker in focus for four hours outproduces a maker in meetings for eight." — uncited quantitative claim.
|
||||
- `assessment.js` — `beatRecommendations.communication.low.recommendations[1]`: "Set expectation: responses within 24 working hours, not minutes" — BEAT's own figure.
|
||||
- `assessment.js` — `beatRecommendations.communication.low.recommendations[2]`: "Create clear channels: urgent = phone, everything else waits" — BEAT's own rule.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.low.recommendations[0]`: "Plan at 80% capacity, leaving slack for life" — unsourced figure.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.low.recommendations[2]`: "Protect 20% time for learning and exploration" — unsourced figure.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.medium.recommendations[2]`: "Review capacity planning—are you over 80%?" — unsourced figure.
|
||||
- `assessment.js` — `assessmentQuestions[0].question`: "How often do you get uninterrupted blocks of 2+ hours for focused work?" and its option descriptions — BEAT's own thresholds, unsourced.
|
||||
- `assessment.js` — `assessmentQuestions[1].question`: "How many meetings do you have in a typical week?" with the "10+ hours", "5-10 hours", "2-5 hours", "Under 2 hours" bands — BEAT's own bands, unsourced.
|
||||
- `assessment.js` — `assessmentQuestions[4].options[2].description`: "24-hour response is acceptable" — BEAT's own figure; the README says "24 working hours", so the two differ.
|
||||
- `assessment.js` — `assessmentQuestions[11].options[3].description`: "20% for exploration built in" — unsourced figure.
|
||||
- `assessment.js` — `assessmentQuestions[2]`, `assessmentQuestions[6]`, `assessmentQuestions[7]`, `assessmentQuestions[8]`, `assessmentQuestions[9]`, `assessmentQuestions[10]`: their option sets ("Hours worked / time online", "Pull-based", "Cut scope", …) — BEAT's own scales, unsourced and not tied to the twelve principles.
|
||||
- `assessment.js` — `overallAssessment`: the ranges [12, 24], [25, 36], [37, 42], [43, 48] — BEAT's own bands, no stated derivation.
|
||||
- `assessment.js` — `overallAssessment.struggling.description`: "Your team faces significant challenges that BEAT is designed to solve. The good news: there's tremendous potential for improvement." — uncited effectiveness claim; expect reword ("tremendous" is also marketing language).
|
||||
- `assessment.js` — `overallAssessment.developing.description`: "BEAT can provide the structure to level up." — uncited effectiveness claim; expect reword.
|
||||
- `assessment.js` — `overallAssessment.strong.description`: "Formalizing them will help you scale and onboard new members." — uncited effectiveness claim; expect reword.
|
||||
- `assessment.js` — `overallAssessment.excellent.description`: "Congratulations! Your team is already aligned with BEAT principles. Consider adopting the framework formally." — uncited claim; "Congratulations!" is also marketing language.
|
||||
- `assessment.js` — `overallAssessment.*.callToAction`: the four call-to-action strings ("Start with the biggest pain point. Small changes compound over time.", "Focus on making existing good practices consistent and documented.", "Document what works and share it with your organization.", "You're ready to fully adopt BEAT and become ambassadors for these practices.") — BEAT's own advice, uncited.
|
||||
- `assessment.js` — `assessmentQuestions[5].options[3].description`: "Clear escalation path" / "Urgent = phone, else async" — BEAT's own rule.
|
||||
- `assessment.js` — `beatRecommendations.*.title`: the twelve band titles ("Your Focus is Under Attack", "Focus Needs Protection", "Strong Focus Culture", "Communication is Chaotic", "Communication Needs Structure", "Effective Async Communication", "Trust is Missing", "Autonomy is Inconsistent", "High-Trust Environment", "Burnout Risk is High", "Sustainability Needs Attention", "Sustainable Pace Culture") — twelve copy strings, uncited, no source needed beyond the source-of-truth statement (WP-05).
|
||||
- `assessment.js` — `beatRecommendations.focus.medium.description`: "With more structure, your team could dramatically increase productivity." — uncited effectiveness claim; expect reword.
|
||||
- `assessment.js` — `beatRecommendations.communication.medium.beatPrinciple`: "Synchronous time is expensive. Spend it wisely. If it can be written, write it." — mirrors README Principle 5, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.communication.high.beatPrinciple`: "Response time is not reaction time. Async means responding when working, not responding immediately." — mirrors README Principle 6, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.autonomy.low.beatPrinciple`: "Trust makers to make. Those who build the thing decide how to build it." — mirrors README Principle 7, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.autonomy.medium.beatPrinciple`: "The maker's \"no\" is valid. This is not insubordination—it is ownership." — mirrors README Principle 9, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.autonomy.high.beatPrinciple`: "Pull, don't push. Work is not assigned. Work is pulled by those with capacity and interest." — mirrors README Principle 8, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.medium.beatPrinciple`: "The team's health is the Enabler's responsibility. Someone must watch for warning signs." — mirrors README Principle 11, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.high.beatPrinciple`: "Exploration time is not a reward. It is a requirement. This is how we stay sharp." — mirrors README Principle 12, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.low.beatPrinciple`: "Sustainable pace is not optional. Overtime is a red flag, not a badge of honor." — mirrors README Principle 10, unsourced.
|
||||
- `assessment.js` — `beatRecommendations.focus.high.description`: "Your team values deep work. BEAT can help you maintain and strengthen this culture as you scale." — uncited effectiveness claim; expect reword.
|
||||
- `assessment.js` — `beatRecommendations.focus.high.beatPrinciple`: "Interruptions are not free. Every \"quick question\" costs more than it appears." — uncited claim, the closing sentence of the same research paragraph as README Principle 2.
|
||||
- `assessment.js` — `beatRecommendations.communication.low.description`: "Without written documentation and async practices, knowledge is lost, decisions are forgotten, and everyone stays chained to chat." — uncited claim; expect citation.
|
||||
- `assessment.js` — `beatRecommendations.communication.low.beatPrinciple`: "Writing is thinking made visible. Decisions not documented did not happen." — uncited claim, mirrors README Principle 5.
|
||||
- `assessment.js` — `beatRecommendations.communication.medium.description`: "You have some good practices, but inconsistency leads to confusion about when to interrupt vs. when to wait." — uncited claim; expect citation.
|
||||
- `assessment.js` — `beatRecommendations.communication.high.description`: "Your team communicates well asynchronously. Keep refining and documenting these practices." — uncited effectiveness claim; expect reword.
|
||||
- `assessment.js` — `beatRecommendations.autonomy.low.description`: "Top-down control stifles creativity and ownership. Developers who can't make decisions become disengaged and stop innovating." — uncited claim; expect citation.
|
||||
- `assessment.js` — `beatRecommendations.autonomy.medium.description`: "Some freedom exists, but it varies. Building genuine trust requires consistent practices." — uncited claim; expect citation.
|
||||
- `assessment.js` — `beatRecommendations.autonomy.high.description`: "Your team operates with real autonomy. This is rare and valuable—protect it." — uncited claim; expect citation.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.low.description`: "Regular overtime and no time for learning is a recipe for burnout, turnover, and declining quality." — uncited claim; expect citation.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.medium.description`: "You're managing, but there are warning signs. Building in more slack now prevents bigger problems later." — uncited claim; expect citation.
|
||||
- `assessment.js` — `beatRecommendations.sustainability.high.description`: "Your team has built healthy work habits. This enables long-term high performance." — uncited effectiveness claim; expect reword.
|
||||
- `assessment.js` — `beatRecommendations.*.description`: the twelve band descriptions (all listed above) — twelve copy strings, uncited, no source needed beyond the source-of-truth statement (WP-05).
|
||||
- `assessment.js` — `beatRecommendations.*.beatPrinciple`: the twelve band principle lines (all listed above) — twelve copy strings, uncited, no source needed beyond the source-of-truth statement (WP-05).
|
||||
- `assessment.js` — `overallAssessment.*.title`: the four overall band titles ("Significant Opportunity for Improvement", "Building Better Practices", "Strong Foundation", "BEAT-Ready Team") — four copy strings, uncited, no source needed beyond the source-of-truth statement (WP-05).
|
||||
|
||||
### public/src/views
|
||||
|
||||
- `HomeView.vue` — hero prose: "A software delivery methodology built for how developers actually work." — uncited effectiveness claim.
|
||||
- `HomeView.vue` — "Our Philosophy": "BEAT emerges from research on how developers actually work. We built it for these realities, not against them." — uncited framing of the `researchStats` block as research.
|
||||
- `HomeView.vue` — "Our Philosophy": the five rendered `researchStats` values ("52 minutes", "23 minutes", "14%", "4 hours", "72%") — uncited figures, three wrong.
|
||||
- `HomeView.vue` — `keyNumbers`: "4hrs", "2hrs", "80%", "20%" — BEAT's own figures shown without attribution.
|
||||
- `HomeView.vue` — `commitments`: "We will not interrupt sacred time. We will wait." — the absolute form of the principle that the incident carve-out suspends.
|
||||
- `FrameworkView.vue` — "The Numbers": the nine `constraints` rows — uncited figures.
|
||||
- `FrameworkView.vue` — "WIP Limit": "3 items per maker" — BEAT's own figure.
|
||||
- `FrameworkView.vue` — "Stale Items": "Return to backlog after 5 days" — BEAT's own figure.
|
||||
- `FrameworkView.vue` — "Work Items": "We do not groom. We do not point. We do not track velocity." — BEAT's own prohibitions, unscoped.
|
||||
- `FrameworkView.vue` — "Beats": "We work in beats—flexible iterations of one to two weeks." — BEAT's own definition.
|
||||
- `FrameworkView.vue` — "Roles": "The Enabler ... maintain the priority stack" against "Work is not assigned" — the contradiction in site prose.
|
||||
- `PracticesView.vue` — "Collaboration": "We do not schedule pairing. We do not mandate walkthroughs. We do not assign buddies." — conflicts with the onboarding buddy.
|
||||
- `PracticesView.vue` — "Meetings": the ceremony durations "30 min", "30 min", "≤25 min", "≤1 hr" — BEAT's own figures.
|
||||
- `PracticesView.vue` — "Daily Check-in": "Post once daily, when convenient. Two minutes." — BEAT's own figures.
|
||||
- `PracticesView.vue` — "Technical Practices": "Aim for PRs reviewable in under 30 minutes" — BEAT's own figure.
|
||||
- `PracticesView.vue` — "Multi-Maker Work": "Break vertically", "Define interfaces first", "Coordinate via doc", "Sync only when stuck" — BEAT's own rules, no scope or owner stated (see WP-47).
|
||||
- `ValuesView.vue` — "Values in Action": "These values are not just words on a page." — uncited claim about the effect of the values.
|
||||
- `PracticesView.vue` — "Incidents & Emergencies": "Someone claims ownership within 15 minutes", "Brief status updates every 30 minutes until resolved", "Async post-mortem within 48 hours", "Sacred blocks are suspended" — BEAT's own figures and the unscoped exception.
|
||||
- `PracticesView.vue` — "Definition of Done": "Tests pass (existing and new where appropriate)" and "Deployable (or deployed, depending on team practice)" — conditional criteria.
|
||||
- `PracticesView.vue` — "Technical Practices": "Aim for PRs reviewable in under 30 minutes" — BEAT's own figure.
|
||||
- `ReferenceView.vue` — "The Numbers": the nine `constraints` rows — uncited figures.
|
||||
- `ReferenceView.vue` — "Definition of Done (Code)": the six rendered `definitionOfDone.code` items, including "Tests pass (existing and new where appropriate)" and "Deployable (or deployed, depending on team practice)" — conditional criteria rendered with no source.
|
||||
- `README.md` — "Appendix: Quick Reference" → "Definition of Done": the trimmed block ("✓ Tests pass", "✓ Deployable", "✓ No known defects") — the conditions of the full wording are dropped here, so the appendix states a looser criterion than the body of the README.
|
||||
- `ReferenceView.vue` — "Incident Protocol": "Acknowledge (15 min)", "Communicate (every 30 min)", "Document (within 48 hrs)" — BEAT's own figures.
|
||||
- `ReferenceView.vue` — "Spotted Issue Decision": "5 minutes or less?" and "More than 5 minutes?" — BEAT's own figures.
|
||||
- `AntiPatternsView.vue` — "Where BEAT Fits": the six, four and three suitability claims — uncited.
|
||||
- `AssessmentView.vue` — the assessment teaser row: "3-5 min" (time to complete), "Anonymous" and "Instant results" — BEAT's own figures and claims, unsourced and unverified.
|
||||
- `AssessmentView.vue` — "{{ totalScore }} / 48" and the four band titles — BEAT's own bands, no stated derivation.
|
||||
- `AssessmentView.vue` — `categoryScores` thresholds (0.4 / 0.7) — unsourced thresholds that disagree with `overallAssessment` (see WP-18).
|
||||
- `AntiPatternsView.vue` — "When BEAT Isn't Working": "Burnout despite 80% planning" — the same unsourced 80% figure as the README, and no threshold behind it (see WP-48).
|
||||
- `AntiPatternsView.vue` — the four anti-pattern tables rendered from `manifesto.js` — `antiPatterns` — each "The Fix" cell is BEAT's own rule with no source.
|
||||
- `PracticesView.vue` — "Meetings": `meetingLimits` "2 hours" / "per week total" and "1 hour" / "maximum per meeting" — BEAT's own figures.
|
||||
- `OnboardingView.vue` — "Connector's Responsibility": "New member has a \"buddy\" for questions (informal, not mandatory pairing)" — conflicts with the collaboration rule.
|
||||
- `OnboardingView.vue` — the four week blocks and "First Month Expectations" — BEAT's own rules, unsourced.
|
||||
- `AssessmentView.vue` — the hero subtitle: "Discover how BEAT can help your team deliver better and faster." — uncited effectiveness claim; expect reword.
|
||||
- `AssessmentView.vue` — the intro paragraph: "Answer 12 quick questions about your current practices. We'll analyze your responses and show you specifically how BEAT principles can help your team." — uncited effectiveness claim and the "12 quick questions" figure (the assessment holds 12 questions, but the count is BEAT's own, not sourced).
|
||||
|
||||
### Consistency items that carry no figure but break the citation pass
|
||||
|
||||
- `README.md` — "Where BEAT Fits" has no site counterpart list of the same size; `AntiPatternsView.vue` renders it from `manifesto.js` — `whereItFits` (see WP-50).
|
||||
- `README.md` — "Customer & User Feedback" is absent from `public/src/data` and `public/src/views` entirely (see WP-50).
|
||||
- `public/src/views/AssessmentView.vue` and `public/src/data/assessment.js` have no README counterpart (see WP-51).
|
||||
|
||||
---
|
||||
|
||||
## Planned resolutions summary
|
||||
|
||||
Each planned resolution names the file and the section or data key that will carry the corrected text, so the repair card can work from this record directly.
|
||||
|
||||
| Weak point | README section | Site data key | Site view |
|
||||
|---|---|---|---|
|
||||
| WP-01, WP-02, WP-03, WP-11–WP-15 | "What We Have Learned" | `researchStats` | `HomeView.vue` — "Our Philosophy" |
|
||||
| WP-04, WP-09, WP-10 | Principles 1, 2, 3 | `principles.focus` | `PrinciplesView.vue` |
|
||||
| WP-05, WP-16, WP-17, WP-37 | "Appendix: Quick Reference" → "The Numbers" | `constraints`, `priorityBuckets` | `FrameworkView.vue` — "The Numbers", `ReferenceView.vue` — "The Numbers" |
|
||||
| WP-06 | "Where BEAT Fits" | `whereItFits` | `AntiPatternsView.vue` — "Where BEAT Fits" |
|
||||
| WP-07 | Principle 10 | `principles.sustainability` | `PrinciplesView.vue` |
|
||||
| WP-08 | "Customer & User Feedback" | new `customerFeedback` | new site section |
|
||||
| WP-19, WP-22 | "Incidents & Emergencies" | `incidentProtocol`, `principles` | `PracticesView.vue` — "Incidents & Emergencies" |
|
||||
| WP-20, WP-41 | "Prioritization" | `priorityBuckets`, `roles` | `FrameworkView.vue` — "Prioritization Buckets" |
|
||||
| WP-21, WP-42 | "Definition of Done" | `definitionOfDone.code` | `PracticesView.vue` — "Definition of Done", `ReferenceView.vue` — "Definition of Done (Code)" |
|
||||
| WP-23, WP-39, WP-46 | "Onboarding to BEAT" | `onboarding` | `OnboardingView.vue`, `PracticesView.vue` — "Collaboration" |
|
||||
| WP-24, WP-25, WP-26, WP-32–WP-36, WP-38, WP-43 | "Avoiding Chokepoints", "The Board", "Spotted Issues", "Work Items", "Technical Practices (Optional)" | `constraints`, `technicalPractices`, `definitionOfDone.code` | `FrameworkView.vue`, `PracticesView.vue`, `ReferenceView.vue` |
|
||||
| WP-27, WP-28 | Principle 12, Principle 10, "The Board" | `principles.sustainability`, `constraints` | `FrameworkView.vue` — "The Board" |
|
||||
| WP-29 | "Where BEAT Fits", "Onboarding to BEAT" | `whereItFits.fitsPoorly`, `onboarding` | `AntiPatternsView.vue`, `OnboardingView.vue` |
|
||||
| WP-30, WP-31 | Principle 6 | `principles.communication`, `incidentProtocol` | `AssessmentView.vue` |
|
||||
| WP-18 | new README assessment section | `overallAssessment` | `AssessmentView.vue` — `categoryScores`, `overallLevel` |
|
||||
| WP-40 | "Beats" | `antiPatterns.organizational` | `FrameworkView.vue` — "Beats" |
|
||||
| WP-44 | new "On-call and incident rotation" | new `onCall` | `PracticesView.vue` |
|
||||
| WP-45 | new "Working across time zones" | new `timeZones` | `PracticesView.vue` |
|
||||
| WP-47 | new "Dependencies across teams" | new `crossTeamDependencies` | `PracticesView.vue` |
|
||||
| WP-48 | new "Accountability and measurement" | new `measurement` | `PracticesView.vue` |
|
||||
| WP-49–WP-52 | "The BEAT Commitment", "Customer & User Feedback", "The Board", new assessment section | `commitments` (`HomeView.vue`), `customerFeedback`, `constraints` | `HomeView.vue`, `AssessmentView.vue` |
|
||||
+25
-35
@@ -4,57 +4,47 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#3b82f6" />
|
||||
|
||||
<meta name="theme-color" content="#1d4ed8" />
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>BEAT - Balanced. Empowered. Async. Teams.</title>
|
||||
<meta name="description" content="The BEAT Manifesto - A software delivery methodology built for how developers actually work. Deep work, async communication, individual autonomy, sustainable pace." />
|
||||
<meta name="keywords" content="BEAT, software development methodology, agile alternative, remote work, async communication, deep work, developer productivity" />
|
||||
<title>Home — BEAT Manifesto</title>
|
||||
<meta name="description" content="The BEAT manifesto: a software delivery method for balanced, empowered, async teams. Deep work, written decisions, individual autonomy and a sustainable pace." />
|
||||
<meta name="author" content="Lukasz Raczylo" />
|
||||
|
||||
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="BEAT - Balanced. Empowered. Async. Teams." />
|
||||
<meta property="og:description" content="A software delivery methodology built for how developers actually work." />
|
||||
<meta property="og:title" content="BEAT Manifesto" />
|
||||
<meta property="og:description" content="A software delivery method for balanced, empowered, async teams." />
|
||||
<meta property="og:site_name" content="BEAT Manifesto" />
|
||||
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:title" content="BEAT - Balanced. Empowered. Async. Teams." />
|
||||
<meta property="twitter:description" content="A software delivery methodology built for how developers actually work." />
|
||||
|
||||
<!-- Preconnect for performance -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com" />
|
||||
|
||||
<!-- Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<!-- Dark mode initialization (prevents flash) -->
|
||||
<meta property="twitter:title" content="BEAT Manifesto" />
|
||||
<meta property="twitter:description" content="A software delivery method for balanced, empowered, async teams." />
|
||||
|
||||
<!-- Theme initialization (prevents flash) -->
|
||||
<script>
|
||||
(function() {
|
||||
const theme = localStorage.theme;
|
||||
const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
if (theme === 'dark' || (!theme && systemDark)) {
|
||||
document.documentElement.classList.add('dark');
|
||||
}
|
||||
var stored = null;
|
||||
try { stored = window.localStorage.getItem('beat-theme'); } catch (e) { stored = null; }
|
||||
var systemDark = false;
|
||||
try { systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch (e) { systemDark = false; }
|
||||
var dark = stored === 'dark' || (stored !== 'light' && systemDark);
|
||||
document.documentElement.classList.toggle('dark', dark);
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 transition-colors duration-300 antialiased">
|
||||
<!-- Skip to main content link for accessibility -->
|
||||
<a href="#main-content" class="skip-link">Skip to main content</a>
|
||||
|
||||
<body class="bg-background font-sans text-body-base text-body antialiased">
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
|
||||
|
||||
<!-- No-JS fallback -->
|
||||
<noscript>
|
||||
<div style="padding: 2rem; text-align: center; font-family: system-ui, sans-serif;">
|
||||
<h1 style="font-size: 1.5rem; margin-bottom: 1rem;">JavaScript Required</h1>
|
||||
<p>This website requires JavaScript to function properly. Please enable JavaScript in your browser settings.</p>
|
||||
<div class="mx-auto max-w-prose px-4 py-10">
|
||||
<h1 class="text-heading font-semibold text-large">JavaScript is required</h1>
|
||||
<p class="mt-3 text-body-base text-body">
|
||||
This site needs JavaScript to show the manifesto. Enable JavaScript in your browser and reload the page.
|
||||
</p>
|
||||
</div>
|
||||
</noscript>
|
||||
</body>
|
||||
|
||||
Generated
+63
-31
@@ -8,12 +8,15 @@
|
||||
"name": "beat-methodology",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^6.7.2",
|
||||
"vue": "^3.4.21",
|
||||
"vue-router": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^6.0.0",
|
||||
"autoprefixer": "^10.4.18",
|
||||
"axe-core": "^4.14.0",
|
||||
"playwright-core": "^1.64.1",
|
||||
"postcss": "^8.4.35",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"vite": "^8.0.0"
|
||||
@@ -78,6 +81,15 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@fortawesome/fontawesome-free": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz",
|
||||
"integrity": "sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==",
|
||||
"license": "(CC-BY-4.0 AND OFL-1.1 AND MIT)",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||
@@ -178,6 +190,7 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -194,6 +207,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -210,6 +224,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -226,6 +241,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -242,6 +258,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -258,6 +275,7 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -274,9 +292,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -293,9 +309,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -312,9 +326,7 @@
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -331,9 +343,7 @@
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -350,9 +360,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -369,9 +377,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -388,6 +394,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -404,6 +411,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -420,6 +428,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -793,6 +802,16 @@
|
||||
"postcss": "^8.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/axe-core": {
|
||||
"version": "4.14.0",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.14.0.tgz",
|
||||
"integrity": "sha512-9WTZxEjsZ7b13TH8JPmbV2z8CHbl80/2hm3XPEG4JgNdQLK81IBRXmSxHfMAOkSqQeRxT/0dwNDz2GOm3zzpcQ==",
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/baseline-browser-mapping": {
|
||||
"version": "2.11.27",
|
||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.27.tgz",
|
||||
@@ -1115,6 +1134,7 @@
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
@@ -1233,7 +1253,7 @@
|
||||
"version": "1.21.7",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz",
|
||||
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
|
||||
"devOptional": true,
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"jiti": "bin/jiti.js"
|
||||
@@ -1276,6 +1296,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1296,6 +1317,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1316,6 +1338,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1336,6 +1359,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1356,6 +1380,7 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1376,9 +1401,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1399,9 +1422,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1422,9 +1443,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1445,9 +1464,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1468,6 +1485,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1488,6 +1506,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -1766,6 +1785,19 @@
|
||||
"pathe": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.64.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.1.tgz",
|
||||
"integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.32",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz",
|
||||
|
||||
+4
-1
@@ -5,16 +5,19 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"build": "vite build && node ../scripts/generate-404.mjs",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^6.7.2",
|
||||
"vue": "^3.4.21",
|
||||
"vue-router": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^6.0.0",
|
||||
"autoprefixer": "^10.4.18",
|
||||
"axe-core": "^4.14.0",
|
||||
"playwright-core": "^1.64.1",
|
||||
"postcss": "^8.4.35",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"vite": "^8.0.0"
|
||||
|
||||
+47
-83
@@ -1,91 +1,55 @@
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
import NavBar from '@/components/layout/NavBar.vue'
|
||||
import Footer from '@/components/layout/Footer.vue'
|
||||
import ReadingProgress from '@/components/layout/ReadingProgress.vue'
|
||||
import { nextTick, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import SiteHeader from '@/components/layout/SiteHeader.vue'
|
||||
import SiteFooter from '@/components/layout/SiteFooter.vue'
|
||||
|
||||
onMounted(() => {
|
||||
document.documentElement.style.scrollBehavior = 'smooth'
|
||||
})
|
||||
const route = useRoute()
|
||||
const mainRef = ref(null)
|
||||
|
||||
// The hash history reads `#main-content` as a route path, so the skip link
|
||||
// moves focus itself instead of letting the browser change the URL.
|
||||
const skipToMain = () => {
|
||||
mainRef.value?.focus()
|
||||
mainRef.value?.scrollIntoView()
|
||||
}
|
||||
|
||||
// The document title comes from the route meta, so every page has a unique
|
||||
// title and the title cannot drift from the route list.
|
||||
const applyTitle = () => {
|
||||
const title = route.meta.title
|
||||
document.title = title ? `${title} — BEAT Manifesto` : 'BEAT Manifesto'
|
||||
}
|
||||
|
||||
watch(
|
||||
() => route.fullPath,
|
||||
async () => {
|
||||
applyTitle()
|
||||
// Where focus was before the page changed: on a cold load it is the body,
|
||||
// and the browser must keep its own starting focus.
|
||||
const hadFocus = document.activeElement !== null && document.activeElement !== document.body
|
||||
await nextTick()
|
||||
if (!hadFocus) return
|
||||
// Move focus to the main landmark on a page change, so a keyboard or
|
||||
// screen-reader user starts at the new page rather than at the header.
|
||||
mainRef.value?.focus()
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen flex flex-col bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<ReadingProgress />
|
||||
<NavBar />
|
||||
<main class="flex-1">
|
||||
<router-view v-slot="{ Component }">
|
||||
<transition
|
||||
name="page"
|
||||
mode="out-in"
|
||||
appear
|
||||
>
|
||||
<component :is="Component" />
|
||||
</transition>
|
||||
</router-view>
|
||||
<div class="flex min-h-screen flex-col">
|
||||
<a class="skip-link" href="#main-content" @click.prevent="skipToMain">Skip to main content</a>
|
||||
<SiteHeader />
|
||||
<main
|
||||
id="main-content"
|
||||
ref="mainRef"
|
||||
tabindex="-1"
|
||||
class="mx-auto w-full max-w-6xl flex-1 px-4 py-8 sm:px-6 sm:py-12"
|
||||
>
|
||||
<router-view />
|
||||
</main>
|
||||
<Footer />
|
||||
<SiteFooter />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
/* Page transition animations */
|
||||
.page-enter-active,
|
||||
.page-leave-active {
|
||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.page-enter-from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px) scale(0.98);
|
||||
}
|
||||
|
||||
.page-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateY(-10px) scale(0.98);
|
||||
}
|
||||
|
||||
.page-enter-to,
|
||||
.page-leave-from {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
|
||||
/* Ensure content is visible during transition */
|
||||
.page-enter-active > *,
|
||||
.page-leave-active > * {
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
|
||||
/* Improved focus visible styles for accessibility */
|
||||
:focus-visible {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.dark :focus-visible {
|
||||
outline-color: #60a5fa;
|
||||
}
|
||||
|
||||
/* Remove focus outline for mouse users, keep for keyboard */
|
||||
:focus:not(:focus-visible) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Smooth scroll behavior */
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* Reduce motion for users who prefer it */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,536 +2,62 @@
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/**
|
||||
* Base layer of the site.
|
||||
*
|
||||
* Every rule below reads the token layer in `public/src/main.css` (the nine
|
||||
* `--color-*` custom properties) or the type scale in `public/tailwind.config.js`.
|
||||
* No rule here declares a colour value, so the light and dark themes stay in
|
||||
* one place.
|
||||
*/
|
||||
|
||||
@layer base {
|
||||
/* Ensure smooth scrolling */
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
/* Better touch targets on mobile */
|
||||
button, a {
|
||||
touch-action: manipulation;
|
||||
body {
|
||||
@apply bg-background font-sans text-body-base text-body;
|
||||
}
|
||||
|
||||
/* Selection colors */
|
||||
::selection {
|
||||
@apply bg-blue-500/30 text-blue-900 dark:text-blue-100;
|
||||
}
|
||||
|
||||
/* Improved focus visible for accessibility */
|
||||
/* One visible focus ring for every focusable element, in both themes. */
|
||||
:focus-visible {
|
||||
@apply outline-2 outline-offset-2 outline-blue-500;
|
||||
@apply outline-2 outline-offset-2 outline-accent;
|
||||
}
|
||||
|
||||
.dark :focus-visible {
|
||||
@apply outline-blue-400;
|
||||
/* Keyboard-only ring: a pointer click does not draw it. */
|
||||
:focus:not(:focus-visible) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Skip link for accessibility */
|
||||
/* The main landmark takes focus after a page change so a keyboard or
|
||||
screen-reader user starts at the new page. It is not an interactive
|
||||
control, so it draws no ring of its own. */
|
||||
#main-content:focus,
|
||||
#main-content:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Skip link: off screen until focused, then the first thing a keyboard
|
||||
user sees. */
|
||||
.skip-link {
|
||||
@apply sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-2 focus:bg-blue-600 focus:text-white focus:rounded-lg;
|
||||
@apply sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-50 focus:rounded focus:border focus:border-border focus:bg-background focus:px-4 focus:py-2 focus:text-body-base focus:text-foreground;
|
||||
}
|
||||
|
||||
/* Custom scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
::selection {
|
||||
@apply bg-accent text-accent-foreground;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
@apply bg-gray-100 dark:bg-gray-800;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
@apply bg-gray-300 dark:bg-gray-600 rounded-full;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
@apply bg-gray-400 dark:bg-gray-500;
|
||||
}
|
||||
|
||||
/* Responsive base styles */
|
||||
body {
|
||||
@apply text-sm sm:text-base;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@layer components {
|
||||
/* Container that adapts to all screen sizes */
|
||||
.container-responsive {
|
||||
@apply w-full mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 2xl:max-w-7xl 3xl:max-w-8xl 4xl:max-w-9xl;
|
||||
}
|
||||
|
||||
/* Enhanced glass morphism */
|
||||
.glass {
|
||||
@apply bg-white/80 dark:bg-gray-800/80 backdrop-blur-xl border border-white/30 dark:border-gray-700/50;
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.05),
|
||||
0 2px 4px -2px rgba(0, 0, 0, 0.05),
|
||||
inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.dark .glass {
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.3),
|
||||
0 2px 4px -2px rgba(0, 0, 0, 0.2),
|
||||
inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
/* Gradient text with animation */
|
||||
.gradient-text {
|
||||
@apply bg-clip-text text-transparent;
|
||||
background-image: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
|
||||
background-size: 200% 200%;
|
||||
animation: gradient-shift 8s ease infinite;
|
||||
}
|
||||
|
||||
.dark .gradient-text {
|
||||
background-image: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #22d3ee 100%);
|
||||
}
|
||||
|
||||
@keyframes gradient-shift {
|
||||
0%, 100% { background-position: 0% 50%; }
|
||||
50% { background-position: 100% 50%; }
|
||||
}
|
||||
|
||||
/* Modern shadow */
|
||||
.shadow-modern {
|
||||
box-shadow:
|
||||
0 20px 25px -5px rgba(0, 0, 0, 0.08),
|
||||
0 8px 10px -6px rgba(0, 0, 0, 0.05),
|
||||
0 0 0 1px rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
.dark .shadow-modern {
|
||||
box-shadow:
|
||||
0 20px 25px -5px rgba(0, 0, 0, 0.4),
|
||||
0 8px 10px -6px rgba(0, 0, 0, 0.2),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.02);
|
||||
}
|
||||
|
||||
/* Primary button with enhanced effects */
|
||||
.btn-primary {
|
||||
@apply relative overflow-hidden bg-gradient-to-r from-blue-600 to-purple-600 text-white px-4 sm:px-6 py-2.5 sm:py-3 rounded-xl font-semibold transition-all duration-300;
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(59, 130, 246, 0.3),
|
||||
0 2px 4px -2px rgba(59, 130, 246, 0.2),
|
||||
inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.btn-primary::before {
|
||||
content: '';
|
||||
@apply absolute inset-0 bg-gradient-to-r from-purple-600 to-blue-600 opacity-0 transition-opacity duration-300;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
@apply scale-105;
|
||||
box-shadow:
|
||||
0 10px 15px -3px rgba(59, 130, 246, 0.4),
|
||||
0 4px 6px -4px rgba(59, 130, 246, 0.3),
|
||||
inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.btn-primary:hover::before {
|
||||
@apply opacity-100;
|
||||
}
|
||||
|
||||
.btn-primary:active {
|
||||
@apply scale-100;
|
||||
}
|
||||
|
||||
.btn-primary > * {
|
||||
@apply relative z-10;
|
||||
}
|
||||
|
||||
/* Secondary button */
|
||||
.btn-secondary {
|
||||
@apply glass text-gray-900 dark:text-gray-100 px-4 sm:px-6 py-2.5 sm:py-3 rounded-xl font-semibold transition-all duration-300;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
@apply scale-105;
|
||||
box-shadow:
|
||||
0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
||||
0 4px 6px -4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.dark .btn-secondary:hover {
|
||||
box-shadow:
|
||||
0 10px 15px -3px rgba(0, 0, 0, 0.4),
|
||||
0 4px 6px -4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* Section titles - responsive */
|
||||
.section-title {
|
||||
@apply text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-gray-900 dark:text-gray-100 mb-3 sm:mb-4 tracking-tight;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.section-subtitle {
|
||||
@apply text-base sm:text-lg md:text-xl text-gray-600 dark:text-gray-300 px-2 sm:px-0 leading-relaxed;
|
||||
}
|
||||
|
||||
/* Enhanced card with 3D hover */
|
||||
.card {
|
||||
@apply glass p-4 sm:p-6 lg:p-8 rounded-2xl transition-all duration-500;
|
||||
transform-style: preserve-3d;
|
||||
perspective: 1000px;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
@apply -translate-y-1 sm:-translate-y-2;
|
||||
box-shadow:
|
||||
0 25px 50px -12px rgba(0, 0, 0, 0.15),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.1) inset;
|
||||
}
|
||||
|
||||
.dark .card:hover {
|
||||
box-shadow:
|
||||
0 25px 50px -12px rgba(0, 0, 0, 0.5),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.05) inset;
|
||||
}
|
||||
|
||||
/* Navigation link */
|
||||
.nav-link {
|
||||
@apply relative text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 font-medium transition-colors duration-200;
|
||||
}
|
||||
|
||||
.nav-link::after {
|
||||
content: '';
|
||||
@apply absolute -bottom-1 left-0 w-0 h-0.5 bg-gradient-to-r from-blue-500 to-purple-500 transition-all duration-300 rounded-full;
|
||||
}
|
||||
|
||||
.nav-link:hover::after {
|
||||
@apply w-full;
|
||||
}
|
||||
|
||||
/* Icon box */
|
||||
.icon-box {
|
||||
@apply w-10 h-10 sm:w-12 sm:h-12 rounded-xl flex items-center justify-center flex-shrink-0;
|
||||
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
}
|
||||
|
||||
.group:hover .icon-box {
|
||||
transform: scale(1.1) rotate(3deg);
|
||||
}
|
||||
|
||||
/* Section padding - responsive */
|
||||
.section-padding {
|
||||
@apply py-12 sm:py-16 md:py-20 lg:py-24;
|
||||
}
|
||||
|
||||
/* Gradient border effect */
|
||||
.gradient-border {
|
||||
position: relative;
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
|
||||
}
|
||||
|
||||
.gradient-border::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
padding: 1px;
|
||||
border-radius: inherit;
|
||||
background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4);
|
||||
-webkit-mask:
|
||||
linear-gradient(#fff 0 0) content-box,
|
||||
linear-gradient(#fff 0 0);
|
||||
mask:
|
||||
linear-gradient(#fff 0 0) content-box,
|
||||
linear-gradient(#fff 0 0);
|
||||
-webkit-mask-composite: xor;
|
||||
mask-composite: exclude;
|
||||
}
|
||||
|
||||
/* Shimmer loading effect */
|
||||
.shimmer {
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.4) 50%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
background-size: 200% 100%;
|
||||
animation: shimmer 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% { background-position: -200% 0; }
|
||||
100% { background-position: 200% 0; }
|
||||
}
|
||||
|
||||
/* Glow effects */
|
||||
.glow-blue {
|
||||
box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 40px rgba(59, 130, 246, 0.1);
|
||||
}
|
||||
|
||||
.glow-purple {
|
||||
box-shadow: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 40px rgba(139, 92, 246, 0.1);
|
||||
}
|
||||
|
||||
/* Number badge */
|
||||
.number-badge {
|
||||
@apply w-8 h-8 sm:w-10 sm:h-10 rounded-full bg-gradient-to-br from-blue-500 to-purple-500 flex items-center justify-center text-white font-bold text-sm sm:text-base;
|
||||
box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
/* Status indicators */
|
||||
.status-dot {
|
||||
@apply w-2 h-2 rounded-full;
|
||||
animation: pulse-dot 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-dot {
|
||||
0%, 100% { opacity: 1; transform: scale(1); }
|
||||
50% { opacity: 0.5; transform: scale(1.2); }
|
||||
}
|
||||
|
||||
/* Code block styling */
|
||||
.code-block {
|
||||
@apply font-mono text-xs sm:text-sm bg-gray-900 text-gray-100 p-3 sm:p-4 rounded-xl;
|
||||
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
/* Feature highlight */
|
||||
.feature-highlight {
|
||||
@apply relative;
|
||||
}
|
||||
|
||||
.feature-highlight::before {
|
||||
content: '';
|
||||
@apply absolute -inset-2 bg-gradient-to-r from-blue-500/10 to-purple-500/10 rounded-xl -z-10;
|
||||
filter: blur(8px);
|
||||
}
|
||||
|
||||
/* Mobile-optimized touch targets */
|
||||
.touch-target {
|
||||
@apply min-h-[44px] min-w-[44px];
|
||||
}
|
||||
|
||||
/* Responsive table wrapper */
|
||||
.table-wrapper {
|
||||
@apply overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* Responsive grid gaps */
|
||||
.grid-responsive {
|
||||
@apply gap-4 sm:gap-5 lg:gap-6;
|
||||
}
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
/* Animation delays */
|
||||
.animate-delay-100 { animation-delay: 0.1s; }
|
||||
.animate-delay-200 { animation-delay: 0.2s; }
|
||||
.animate-delay-300 { animation-delay: 0.3s; }
|
||||
.animate-delay-400 { animation-delay: 0.4s; }
|
||||
.animate-delay-500 { animation-delay: 0.5s; }
|
||||
.animate-delay-600 { animation-delay: 0.6s; }
|
||||
.animate-delay-700 { animation-delay: 0.7s; }
|
||||
.animate-delay-800 { animation-delay: 0.8s; }
|
||||
.animate-delay-1000 { animation-delay: 1s; }
|
||||
.animate-delay-2000 { animation-delay: 2s; }
|
||||
|
||||
/* Custom animations */
|
||||
.animate-fade-in {
|
||||
animation: fadeIn 0.6s ease-out forwards;
|
||||
}
|
||||
|
||||
.animate-fade-in-up {
|
||||
animation: fadeInUp 0.6s ease-out forwards;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.animate-scale-in {
|
||||
animation: scaleIn 0.5s ease-out forwards;
|
||||
}
|
||||
|
||||
.animate-slide-in-right {
|
||||
animation: slideInRight 0.5s ease-out forwards;
|
||||
}
|
||||
|
||||
.animate-float {
|
||||
animation: float 6s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.animate-pulse-slow {
|
||||
animation: pulse-slow 4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.animate-spin-slow {
|
||||
animation: spin 8s linear infinite;
|
||||
}
|
||||
|
||||
/* Hover lift effect */
|
||||
.hover-lift {
|
||||
@apply transition-all duration-300;
|
||||
}
|
||||
|
||||
.hover-lift:hover {
|
||||
@apply -translate-y-1;
|
||||
box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Text balance for better typography */
|
||||
.text-balance {
|
||||
text-wrap: balance;
|
||||
}
|
||||
|
||||
/* Backdrop blur utilities */
|
||||
.backdrop-blur-xs {
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
/* Safe area for notched phones */
|
||||
.safe-area-inset {
|
||||
padding-left: env(safe-area-inset-left);
|
||||
padding-right: env(safe-area-inset-right);
|
||||
}
|
||||
|
||||
.safe-area-bottom {
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
}
|
||||
|
||||
/* Keyframe animations */
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scaleIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideInRight {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(30px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
||||
33% { transform: translateY(-15px) rotate(1deg); }
|
||||
66% { transform: translateY(-8px) rotate(-1deg); }
|
||||
}
|
||||
|
||||
@keyframes pulse-slow {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
}
|
||||
|
||||
/* Print styles */
|
||||
@media print {
|
||||
.glass {
|
||||
@apply bg-white border-gray-200;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.gradient-text {
|
||||
background: none !important;
|
||||
@apply text-gray-900;
|
||||
}
|
||||
|
||||
/* Hide non-essential elements when printing */
|
||||
nav, footer, .no-print {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Ensure good contrast for printed content */
|
||||
body {
|
||||
@apply text-black bg-white;
|
||||
}
|
||||
|
||||
/* Page breaks */
|
||||
.page-break {
|
||||
page-break-before: always;
|
||||
}
|
||||
|
||||
/* Prevent orphans and widows */
|
||||
p, li {
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* Mobile-specific optimizations */
|
||||
@media (max-width: 640px) {
|
||||
/* Larger touch targets on small screens */
|
||||
button,
|
||||
a {
|
||||
@apply min-h-[44px] min-w-[44px];
|
||||
}
|
||||
|
||||
/* Adjust card padding */
|
||||
.card {
|
||||
@apply p-4;
|
||||
}
|
||||
|
||||
/* Smaller hero text on mobile */
|
||||
.section-title {
|
||||
@apply text-2xl;
|
||||
}
|
||||
}
|
||||
|
||||
/* Tablet optimizations */
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
.card {
|
||||
@apply p-6;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ultrawide screen optimizations */
|
||||
@media (min-width: 1920px) {
|
||||
/* Larger text for better readability at distance */
|
||||
body {
|
||||
@apply text-lg;
|
||||
}
|
||||
|
||||
/* More spacious layouts */
|
||||
.section-padding {
|
||||
@apply py-28;
|
||||
}
|
||||
|
||||
/* Larger cards */
|
||||
.card {
|
||||
@apply p-10;
|
||||
}
|
||||
}
|
||||
|
||||
/* Landscape mode on mobile */
|
||||
@media (max-height: 500px) and (orientation: landscape) {
|
||||
.section-padding {
|
||||
@apply py-8;
|
||||
}
|
||||
|
||||
.hero-min-height {
|
||||
min-height: auto;
|
||||
/* Respect a reduced-motion preference. */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
<script setup>
|
||||
const currentYear = new Date().getFullYear()
|
||||
|
||||
const quickLinks = [
|
||||
{ path: '/values', label: 'Core Values' },
|
||||
{ path: '/principles', label: '12 Principles' },
|
||||
{ path: '/framework', label: 'Framework' },
|
||||
{ path: '/reference', label: 'Quick Reference' },
|
||||
]
|
||||
|
||||
const resources = [
|
||||
{ path: '/assessment', label: 'Team Assessment' },
|
||||
{ path: '/anti-patterns', label: 'Anti-Patterns' },
|
||||
{ path: '/onboarding', label: 'Onboarding' },
|
||||
{ path: '/practices', label: 'Practices' },
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<footer class="relative bg-gray-50 dark:bg-gray-800/50 border-t border-gray-200 dark:border-gray-700 transition-colors duration-300">
|
||||
<!-- Top gradient line -->
|
||||
<div class="absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-blue-500/50 to-transparent"></div>
|
||||
|
||||
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 py-10 sm:py-12 lg:py-16">
|
||||
<!-- Main footer content - responsive grid -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8 lg:gap-12">
|
||||
<!-- Brand -->
|
||||
<div class="sm:col-span-2 lg:col-span-1">
|
||||
<RouterLink to="/" class="flex items-center gap-3 group mb-4">
|
||||
<div
|
||||
class="w-10 h-10 sm:w-12 sm:h-12 rounded-xl bg-gradient-to-br from-blue-600 to-purple-600 flex items-center justify-center transition-all duration-300 group-hover:scale-110 group-hover:rotate-3 group-hover:shadow-glow-blue"
|
||||
>
|
||||
<span class="text-white font-bold text-lg sm:text-xl">B</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-lg sm:text-xl font-bold gradient-text block">BEAT</span>
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400">v1.0</span>
|
||||
</div>
|
||||
</RouterLink>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-sm leading-relaxed mb-2">
|
||||
<strong>B</strong>alanced. <strong>E</strong>mpowered. <strong>A</strong>sync. <strong>T</strong>eams.
|
||||
</p>
|
||||
<p class="text-gray-500 dark:text-gray-500 text-sm">
|
||||
Built for how developers actually work.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Quick Links -->
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2 text-sm sm:text-base">
|
||||
<i class="fas fa-compass text-blue-500 text-sm"></i>
|
||||
Explore
|
||||
</h3>
|
||||
<ul class="space-y-2">
|
||||
<li v-for="link in quickLinks" :key="link.path">
|
||||
<RouterLink
|
||||
:to="link.path"
|
||||
class="text-sm text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 flex items-center gap-2 group"
|
||||
>
|
||||
<span class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-600 group-hover:bg-blue-500 transition-colors"></span>
|
||||
{{ link.label }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Resources -->
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2 text-sm sm:text-base">
|
||||
<i class="fas fa-book text-purple-500 text-sm"></i>
|
||||
Resources
|
||||
</h3>
|
||||
<ul class="space-y-2">
|
||||
<li v-for="link in resources" :key="link.path">
|
||||
<RouterLink
|
||||
:to="link.path"
|
||||
class="text-sm text-gray-600 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 transition-colors duration-200 flex items-center gap-2 group"
|
||||
>
|
||||
<span class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-600 group-hover:bg-purple-500 transition-colors"></span>
|
||||
{{ link.label }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Author -->
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2 text-sm sm:text-base">
|
||||
<i class="fas fa-user text-cyan-500 text-sm"></i>
|
||||
Created By
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-sm mb-4">
|
||||
The BEAT Manifesto was created by <strong class="text-gray-900 dark:text-gray-100">Lukasz Raczylo</strong>.
|
||||
</p>
|
||||
<div class="flex gap-2">
|
||||
<a
|
||||
href="https://github.com/lukaszraczylo"
|
||||
target="_blank"
|
||||
class="w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center text-gray-500 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-all duration-300 hover:scale-110"
|
||||
aria-label="GitHub"
|
||||
>
|
||||
<i class="fab fa-github text-lg"></i>
|
||||
</a>
|
||||
<a
|
||||
href="https://www.linkedin.com/in/raczylo/"
|
||||
target="_blank"
|
||||
class="w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/30 transition-all duration-300 hover:scale-110"
|
||||
aria-label="LinkedIn"
|
||||
>
|
||||
<i class="fab fa-linkedin text-lg"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bottom bar -->
|
||||
<div class="mt-8 sm:mt-10 lg:mt-12 pt-6 sm:pt-8 border-t border-gray-200 dark:border-gray-700">
|
||||
<div class="flex flex-col sm:flex-row justify-between items-center gap-3 sm:gap-4 text-center sm:text-left">
|
||||
<p class="text-gray-500 dark:text-gray-500 text-xs sm:text-sm">
|
||||
© {{ currentYear }} BEAT Manifesto by Lukasz Raczylo
|
||||
</p>
|
||||
<p class="text-gray-400 dark:text-gray-600 text-xs italic">
|
||||
Attribution appreciated. Improvement welcomed. Dogma discouraged.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
@@ -1,229 +0,0 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { RouterLink, useRoute } from 'vue-router'
|
||||
import ThemeToggle from './ThemeToggle.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const mobileMenuOpen = ref(false)
|
||||
const scrolled = ref(false)
|
||||
|
||||
const navItems = [
|
||||
{ path: '/', label: 'Home', icon: 'fas fa-home' },
|
||||
{ path: '/values', label: 'Values', icon: 'fas fa-heart' },
|
||||
{ path: '/principles', label: 'Principles', icon: 'fas fa-compass' },
|
||||
{ path: '/framework', label: 'Framework', icon: 'fas fa-sitemap' },
|
||||
{ path: '/practices', label: 'Practices', icon: 'fas fa-cogs' },
|
||||
{ path: '/onboarding', label: 'Onboarding', icon: 'fas fa-user-plus' },
|
||||
{ path: '/anti-patterns', label: 'Anti-Patterns', icon: 'fas fa-exclamation-triangle' },
|
||||
{ path: '/reference', label: 'Reference', icon: 'fas fa-book' },
|
||||
{ path: '/assessment', label: 'Assessment', icon: 'fas fa-clipboard-check' }
|
||||
]
|
||||
|
||||
const toggleMobileMenu = () => {
|
||||
mobileMenuOpen.value = !mobileMenuOpen.value
|
||||
// Prevent body scroll when menu is open
|
||||
document.body.style.overflow = mobileMenuOpen.value ? 'hidden' : ''
|
||||
}
|
||||
|
||||
const closeMobileMenu = () => {
|
||||
mobileMenuOpen.value = false
|
||||
document.body.style.overflow = ''
|
||||
}
|
||||
|
||||
const handleScroll = () => {
|
||||
scrolled.value = window.scrollY > 20
|
||||
}
|
||||
|
||||
// Close mobile menu on route change
|
||||
watch(() => route.path, () => {
|
||||
closeMobileMenu()
|
||||
})
|
||||
|
||||
// Close mobile menu on escape key
|
||||
const handleEscape = (e) => {
|
||||
if (e.key === 'Escape' && mobileMenuOpen.value) {
|
||||
closeMobileMenu()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('scroll', handleScroll, { passive: true })
|
||||
window.addEventListener('keydown', handleEscape)
|
||||
handleScroll()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('scroll', handleScroll)
|
||||
window.removeEventListener('keydown', handleEscape)
|
||||
document.body.style.overflow = ''
|
||||
})
|
||||
|
||||
import { watch } from 'vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<nav
|
||||
class="fixed w-full z-50 transition-all duration-500"
|
||||
:class="[
|
||||
scrolled
|
||||
? 'bg-white/90 dark:bg-gray-900/90 backdrop-blur-xl shadow-modern'
|
||||
: 'bg-transparent'
|
||||
]"
|
||||
>
|
||||
<!-- Top gradient line -->
|
||||
<div
|
||||
class="h-1 bg-gradient-to-r from-blue-500 via-purple-500 to-cyan-500 transition-all duration-500"
|
||||
:class="scrolled ? 'opacity-100' : 'opacity-0'"
|
||||
></div>
|
||||
|
||||
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12">
|
||||
<div class="flex justify-between h-14 sm:h-16 items-center">
|
||||
<!-- Logo -->
|
||||
<RouterLink
|
||||
to="/"
|
||||
class="flex items-center gap-2 sm:gap-3 group"
|
||||
>
|
||||
<div
|
||||
class="w-8 h-8 sm:w-10 sm:h-10 rounded-lg sm:rounded-xl bg-gradient-to-br from-blue-600 to-purple-600 flex items-center justify-center transition-all duration-300 group-hover:scale-110 group-hover:rotate-3 group-hover:shadow-glow-blue"
|
||||
>
|
||||
<span class="text-white font-bold text-sm sm:text-lg">B</span>
|
||||
</div>
|
||||
<span
|
||||
class="text-lg sm:text-xl font-bold gradient-text hidden sm:inline transition-all duration-300 group-hover:tracking-wide"
|
||||
>BEAT</span>
|
||||
</RouterLink>
|
||||
|
||||
<!-- Desktop Navigation - hidden on mobile, shown on lg+ -->
|
||||
<div class="hidden lg:flex items-center space-x-1">
|
||||
<RouterLink
|
||||
v-for="(item, index) in navItems"
|
||||
:key="item.path"
|
||||
:to="item.path"
|
||||
class="relative px-2 xl:px-3 py-2 text-xs xl:text-sm font-medium rounded-lg transition-all duration-300"
|
||||
:class="[
|
||||
route.path === item.path
|
||||
? 'text-blue-600 dark:text-blue-400 bg-blue-50/50 dark:bg-blue-900/20'
|
||||
: 'text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100/50 dark:hover:bg-gray-800/50'
|
||||
]"
|
||||
:style="{ animationDelay: `${index * 50}ms` }"
|
||||
>
|
||||
{{ item.label }}
|
||||
<!-- Active indicator -->
|
||||
<span
|
||||
v-if="route.path === item.path"
|
||||
class="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-blue-500"
|
||||
></span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
<!-- Right side actions -->
|
||||
<div class="flex items-center gap-1 sm:gap-2">
|
||||
<ThemeToggle />
|
||||
<a
|
||||
href="https://github.com/lukaszraczylo"
|
||||
target="_blank"
|
||||
class="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 sm:p-2.5 rounded-lg min-w-[40px] min-h-[40px] flex items-center justify-center transition-all duration-300 hover:bg-gray-100/50 dark:hover:bg-gray-800/50 hover:scale-110"
|
||||
aria-label="View author on GitHub"
|
||||
>
|
||||
<i class="fab fa-github text-lg sm:text-xl"></i>
|
||||
</a>
|
||||
|
||||
<!-- Mobile menu button -->
|
||||
<button
|
||||
@click="toggleMobileMenu"
|
||||
class="lg:hidden text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 sm:p-2.5 rounded-lg min-w-[44px] min-h-[44px] flex items-center justify-center transition-all duration-300 hover:bg-gray-100/50 dark:hover:bg-gray-800/50"
|
||||
aria-label="Toggle menu"
|
||||
aria-expanded="mobileMenuOpen"
|
||||
aria-controls="mobile-menu"
|
||||
>
|
||||
<transition name="rotate" mode="out-in">
|
||||
<i v-if="!mobileMenuOpen" key="menu" class="fas fa-bars text-lg sm:text-xl"></i>
|
||||
<i v-else key="close" class="fas fa-times text-lg sm:text-xl"></i>
|
||||
</transition>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Mobile Menu Overlay -->
|
||||
<transition
|
||||
enter-active-class="transition duration-300 ease-out"
|
||||
enter-from-class="opacity-0"
|
||||
enter-to-class="opacity-100"
|
||||
leave-active-class="transition duration-200 ease-in"
|
||||
leave-from-class="opacity-100"
|
||||
leave-to-class="opacity-0"
|
||||
>
|
||||
<div
|
||||
v-if="mobileMenuOpen"
|
||||
class="fixed inset-0 bg-black/50 backdrop-blur-sm lg:hidden z-40"
|
||||
@click="closeMobileMenu"
|
||||
aria-hidden="true"
|
||||
></div>
|
||||
</transition>
|
||||
|
||||
<!-- Mobile Menu Panel -->
|
||||
<transition
|
||||
enter-active-class="transition duration-300 ease-out"
|
||||
enter-from-class="opacity-0 -translate-y-4"
|
||||
enter-to-class="opacity-100 translate-y-0"
|
||||
leave-active-class="transition duration-200 ease-in"
|
||||
leave-from-class="opacity-100 translate-y-0"
|
||||
leave-to-class="opacity-0 -translate-y-4"
|
||||
>
|
||||
<div
|
||||
v-if="mobileMenuOpen"
|
||||
id="mobile-menu"
|
||||
class="lg:hidden absolute top-full left-0 right-0 bg-white/95 dark:bg-gray-900/95 backdrop-blur-xl border-b border-gray-200 dark:border-gray-700 shadow-2xl max-h-[80vh] overflow-y-auto"
|
||||
>
|
||||
<div class="px-4 py-4 space-y-1 w-full max-w-7xl mx-auto">
|
||||
<RouterLink
|
||||
v-for="(item, index) in navItems"
|
||||
:key="item.path"
|
||||
:to="item.path"
|
||||
@click="closeMobileMenu"
|
||||
class="flex items-center gap-3 px-4 py-3 rounded-xl font-medium transition-all duration-300"
|
||||
:class="[
|
||||
route.path === item.path
|
||||
? 'text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20'
|
||||
: 'text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800'
|
||||
]"
|
||||
:style="{ animationDelay: `${index * 30}ms` }"
|
||||
>
|
||||
<div
|
||||
class="w-10 h-10 rounded-lg flex items-center justify-center"
|
||||
:class="route.path === item.path ? 'bg-blue-100 dark:bg-blue-800' : 'bg-gray-100 dark:bg-gray-800'"
|
||||
>
|
||||
<i :class="item.icon" class="text-sm"></i>
|
||||
</div>
|
||||
<span class="flex-1">{{ item.label }}</span>
|
||||
<i
|
||||
v-if="route.path === item.path"
|
||||
class="fas fa-chevron-right text-xs text-blue-500"
|
||||
></i>
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
<!-- Mobile menu footer -->
|
||||
<div class="px-4 py-4 border-t border-gray-200 dark:border-gray-700">
|
||||
<p class="text-xs text-center text-gray-500 dark:text-gray-500">
|
||||
BEAT Manifesto v1.0
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.rotate-enter-active,
|
||||
.rotate-leave-active {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.rotate-enter-from,
|
||||
.rotate-leave-to {
|
||||
opacity: 0;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,15 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
title: { type: String, required: true },
|
||||
summary: { type: String, default: '' },
|
||||
eyebrow: { type: String, default: '' }
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="border-b border-border pb-6">
|
||||
<p v-if="eyebrow" class="text-title font-medium text-muted-foreground">{{ eyebrow }}</p>
|
||||
<h1 class="mt-1 text-display-sm font-semibold text-large">{{ title }}</h1>
|
||||
<p v-if="summary" class="mt-4 max-w-prose text-body-lg text-body">{{ summary }}</p>
|
||||
</header>
|
||||
</template>
|
||||
@@ -0,0 +1,16 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
title: { type: String, required: true },
|
||||
summary: { type: String, default: '' }
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="mt-12">
|
||||
<h2 class="text-heading font-semibold text-large">{{ title }}</h2>
|
||||
<p v-if="summary" class="mt-3 max-w-prose text-body-base text-body">{{ summary }}</p>
|
||||
<div class="mt-5">
|
||||
<slot />
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,63 +0,0 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const progress = ref(0)
|
||||
const showBackToTop = ref(false)
|
||||
|
||||
const calculateProgress = () => {
|
||||
const windowHeight = window.innerHeight
|
||||
const documentHeight = document.documentElement.scrollHeight - windowHeight
|
||||
const scrollTop = window.scrollY
|
||||
|
||||
if (documentHeight > 0) {
|
||||
progress.value = Math.min(100, Math.max(0, (scrollTop / documentHeight) * 100))
|
||||
}
|
||||
|
||||
showBackToTop.value = scrollTop > 500
|
||||
}
|
||||
|
||||
const scrollToTop = () => {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('scroll', calculateProgress, { passive: true })
|
||||
calculateProgress()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('scroll', calculateProgress)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Reading Progress Bar -->
|
||||
<div class="fixed top-0 left-0 right-0 h-1 z-[60] bg-transparent">
|
||||
<div
|
||||
class="h-full bg-gradient-to-r from-blue-500 via-purple-500 to-cyan-500 transition-all duration-150 ease-out"
|
||||
:style="{ width: `${progress}%` }"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<!-- Back to Top Button -->
|
||||
<transition
|
||||
enter-active-class="transition duration-300 ease-out"
|
||||
enter-from-class="opacity-0 translate-y-4"
|
||||
enter-to-class="opacity-100 translate-y-0"
|
||||
leave-active-class="transition duration-200 ease-in"
|
||||
leave-from-class="opacity-100 translate-y-0"
|
||||
leave-to-class="opacity-0 translate-y-4"
|
||||
>
|
||||
<button
|
||||
v-if="showBackToTop"
|
||||
@click="scrollToTop"
|
||||
class="fixed bottom-8 right-8 w-12 h-12 rounded-full bg-gradient-to-br from-blue-600 to-purple-600 text-white shadow-lg hover:shadow-xl hover:scale-110 transition-all duration-300 z-50 flex items-center justify-center group"
|
||||
aria-label="Back to top"
|
||||
>
|
||||
<i class="fas fa-arrow-up group-hover:-translate-y-0.5 transition-transform"></i>
|
||||
</button>
|
||||
</transition>
|
||||
</template>
|
||||
@@ -0,0 +1,34 @@
|
||||
<script setup>
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { sections } from '@/router'
|
||||
import { pagesInSection } from '@/router/sections'
|
||||
|
||||
const orderedSections = [...sections].sort((a, b) => a.order - b.order)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<footer class="mt-16 border-t border-border bg-muted">
|
||||
<div class="mx-auto w-full max-w-6xl px-4 py-10 sm:px-6">
|
||||
<nav aria-label="All pages">
|
||||
<div class="grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<div v-for="section in orderedSections" :key="section.id">
|
||||
<h2 class="text-title font-semibold text-large">{{ section.label }}</h2>
|
||||
<ul class="mt-2 space-y-1">
|
||||
<li v-for="page in pagesInSection(section.id)" :key="page.name">
|
||||
<RouterLink
|
||||
:to="page.path"
|
||||
class="rounded text-body-base text-body hover:text-foreground hover:underline"
|
||||
>
|
||||
{{ page.meta.title }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<p class="mt-10 border-t border-border pt-6 text-body-base text-muted-foreground">
|
||||
BEAT manifesto by Lukasz Raczylo. Balanced, empowered, async teams.
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
@@ -0,0 +1,143 @@
|
||||
<script setup>
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||
import { RouterLink, useRoute } from 'vue-router'
|
||||
import { sections } from '@/router'
|
||||
import { pagesInSection } from '@/router/sections'
|
||||
import ThemeToggle from '@/components/theme/ThemeToggle.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const menuOpen = ref(false)
|
||||
const menuButton = ref(null)
|
||||
|
||||
// The current section comes from route meta, so a new page appears in the
|
||||
// wayfinding as soon as the router lists it.
|
||||
const currentSection = computed(() => route.meta.section ?? sections[0].id)
|
||||
const currentSectionLabel = computed(
|
||||
() => sections.find((section) => section.id === currentSection.value)?.label ?? ''
|
||||
)
|
||||
const sectionPages = computed(() => pagesInSection(currentSection.value))
|
||||
const orderedSections = computed(() => [...sections].sort((a, b) => a.order - b.order))
|
||||
|
||||
// A section link lands on the first page of that section. No section is empty,
|
||||
// and pagesInSection sorts by meta.sectionOrder.
|
||||
const sectionPath = (sectionId) => pagesInSection(sectionId)[0]?.path ?? '/'
|
||||
|
||||
const closeMenu = () => {
|
||||
menuOpen.value = false
|
||||
}
|
||||
|
||||
const onKeydown = (event) => {
|
||||
if (event.key === 'Escape' && menuOpen.value) {
|
||||
closeMenu()
|
||||
menuButton.value?.focus()
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => route.fullPath, closeMenu)
|
||||
|
||||
onMounted(() => window.addEventListener('keydown', onKeydown))
|
||||
onUnmounted(() => window.removeEventListener('keydown', onKeydown))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="sticky top-0 z-40 border-b border-border bg-background">
|
||||
<div class="mx-auto w-full max-w-6xl px-4 sm:px-6">
|
||||
<div class="flex min-h-[3.5rem] items-center justify-between gap-2">
|
||||
<RouterLink
|
||||
to="/"
|
||||
class="rounded px-1 py-2 text-title font-semibold text-foreground"
|
||||
aria-label="BEAT manifesto, home"
|
||||
>
|
||||
BEAT
|
||||
</RouterLink>
|
||||
|
||||
<div class="flex items-center gap-1">
|
||||
<ThemeToggle />
|
||||
<button
|
||||
ref="menuButton"
|
||||
type="button"
|
||||
class="inline-flex min-h-[44px] min-w-[44px] items-center justify-center gap-2 rounded px-2 text-body-base font-semibold text-foreground hover:bg-muted lg:hidden"
|
||||
:aria-expanded="menuOpen"
|
||||
aria-controls="site-menu"
|
||||
@click="menuOpen = !menuOpen"
|
||||
>
|
||||
<i :class="menuOpen ? 'fas fa-times' : 'fas fa-bars'" aria-hidden="true"></i>
|
||||
{{ menuOpen ? 'Close' : 'Menu' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Desktop wayfinding: site navigation, then the pages of the current
|
||||
section. Both are built from the router config. -->
|
||||
<div class="hidden pb-3 lg:block">
|
||||
<nav aria-label="Sections">
|
||||
<ul class="flex flex-wrap items-center gap-x-1">
|
||||
<li v-for="section in orderedSections" :key="section.id">
|
||||
<RouterLink
|
||||
:to="sectionPath(section.id)"
|
||||
class="inline-block rounded px-2 py-1.5 text-body-base text-body hover:bg-muted hover:text-foreground"
|
||||
:class="{ 'font-semibold text-accent': section.id === currentSection }"
|
||||
:aria-current="section.id === currentSection ? 'true' : undefined"
|
||||
>
|
||||
{{ section.label }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav :aria-label="`${currentSectionLabel} pages`" class="mt-1">
|
||||
<ul class="flex flex-wrap items-center gap-x-1">
|
||||
<li v-for="page in sectionPages" :key="page.name">
|
||||
<RouterLink
|
||||
:to="page.path"
|
||||
class="inline-block rounded px-2 py-1.5 text-body-base text-muted-foreground hover:bg-muted hover:text-foreground"
|
||||
:class="{ 'font-semibold text-foreground underline underline-offset-4': page.name === route.name }"
|
||||
:aria-current="page.name === route.name ? 'page' : undefined"
|
||||
>
|
||||
{{ page.meta.title }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- Small screens: both navigations collapse into one keyboard-operated
|
||||
menu. It is a real button above, so Enter and Space open it. -->
|
||||
<div v-if="menuOpen" id="site-menu" class="border-t border-border pb-4 lg:hidden">
|
||||
<nav aria-label="Sections" class="pt-3">
|
||||
<p class="px-2 text-body-base font-semibold text-muted-foreground">Sections</p>
|
||||
<ul class="mt-1">
|
||||
<li v-for="section in orderedSections" :key="section.id">
|
||||
<RouterLink
|
||||
:to="sectionPath(section.id)"
|
||||
class="block rounded px-2 py-2 text-body-base text-body hover:bg-muted hover:text-foreground"
|
||||
:class="{ 'font-semibold text-accent': section.id === currentSection }"
|
||||
:aria-current="section.id === currentSection ? 'true' : undefined"
|
||||
@click="closeMenu"
|
||||
>
|
||||
{{ section.label }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav :aria-label="`${currentSectionLabel} pages`" class="mt-4">
|
||||
<p class="px-2 text-body-base font-semibold text-muted-foreground">
|
||||
{{ currentSectionLabel }} pages
|
||||
</p>
|
||||
<ul class="mt-1">
|
||||
<li v-for="page in sectionPages" :key="page.name">
|
||||
<RouterLink
|
||||
:to="page.path"
|
||||
class="block rounded px-2 py-2 text-body-base text-body hover:bg-muted hover:text-foreground"
|
||||
:class="{ 'font-semibold text-foreground underline underline-offset-4': page.name === route.name }"
|
||||
:aria-current="page.name === route.name ? 'page' : undefined"
|
||||
@click="closeMenu"
|
||||
>
|
||||
{{ page.meta.title }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
@@ -1,31 +0,0 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
const isDark = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
isDark.value = document.documentElement.classList.contains('dark')
|
||||
})
|
||||
|
||||
const toggleTheme = () => {
|
||||
isDark.value = !isDark.value
|
||||
if (isDark.value) {
|
||||
document.documentElement.classList.add('dark')
|
||||
localStorage.theme = 'dark'
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark')
|
||||
localStorage.theme = 'light'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
@click="toggleTheme"
|
||||
class="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 min-w-[44px] min-h-[44px] flex items-center justify-center transition-colors duration-200"
|
||||
aria-label="Toggle theme"
|
||||
>
|
||||
<i v-if="isDark" class="fas fa-sun text-xl"></i>
|
||||
<i v-else class="fas fa-moon text-xl"></i>
|
||||
</button>
|
||||
</template>
|
||||
@@ -0,0 +1,32 @@
|
||||
<script setup>
|
||||
import { onUnmounted, ref } from 'vue'
|
||||
import { isDarkTheme, onThemeChange, toggleTheme } from './theme'
|
||||
|
||||
// The theme is already on the root element when the app mounts, so the
|
||||
// initial state is read straight from it.
|
||||
const isDark = ref(isDarkTheme())
|
||||
|
||||
const onToggle = () => {
|
||||
isDark.value = toggleTheme() === 'dark'
|
||||
}
|
||||
|
||||
// The theme can also change without a click, when the site follows the
|
||||
// system preference, so the button keeps its icon and label in step.
|
||||
const unsubscribe = onThemeChange((theme) => {
|
||||
isDark.value = theme === 'dark'
|
||||
})
|
||||
|
||||
onUnmounted(unsubscribe)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center justify-center min-w-[44px] min-h-[44px] rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent transition-colors duration-200"
|
||||
:aria-label="isDark ? 'Switch to light theme' : 'Switch to dark theme'"
|
||||
@click="onToggle"
|
||||
>
|
||||
<i v-if="isDark" class="fas fa-sun text-lg" aria-hidden="true"></i>
|
||||
<i v-else class="fas fa-moon text-lg" aria-hidden="true"></i>
|
||||
</button>
|
||||
</template>
|
||||
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* Theme handling for the light and dark themes.
|
||||
*
|
||||
* The stored choice wins: localStorage holds it under THEME_STORAGE_KEY.
|
||||
* With nothing stored the site follows the prefers-color-scheme media query,
|
||||
* and keeps following it for as long as no explicit choice is made.
|
||||
* The dark theme is active while the root element carries the class "dark".
|
||||
*
|
||||
* The module is free of Vue imports so the pre-mount bootstrap in main.js
|
||||
* can use it before the app exists.
|
||||
*/
|
||||
|
||||
/** localStorage key that holds the reader's choice. */
|
||||
export const THEME_STORAGE_KEY = 'beat-theme'
|
||||
|
||||
const DARK_CLASS = 'dark'
|
||||
const DARK_QUERY = '(prefers-color-scheme: dark)'
|
||||
const THEMES = ['light', 'dark']
|
||||
|
||||
/** The subscribers that want to know when the active theme changes. */
|
||||
const subscribers = new Set()
|
||||
|
||||
/** Tell the subscribers that the theme is now this one. */
|
||||
function notify (theme) {
|
||||
for (const subscriber of [...subscribers]) subscriber(theme)
|
||||
}
|
||||
|
||||
/**
|
||||
* The stored theme, or null when nothing valid is stored.
|
||||
* Storage can be unavailable (private mode, blocked cookies); that is not an
|
||||
* error, it only means there is no stored choice.
|
||||
*/
|
||||
export function readStoredTheme () {
|
||||
try {
|
||||
const value = window.localStorage.getItem(THEME_STORAGE_KEY)
|
||||
return THEMES.includes(value) ? value : null
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/** True when the system asks for the dark theme. */
|
||||
export function systemPrefersDark () {
|
||||
try {
|
||||
return typeof window.matchMedia === 'function' && window.matchMedia(DARK_QUERY).matches === true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/** The theme to show: the stored choice wins, the system preference is the default. */
|
||||
export function resolveTheme () {
|
||||
return readStoredTheme() ?? (systemPrefersDark() ? 'dark' : 'light')
|
||||
}
|
||||
|
||||
/** Put the theme on the root element and return the theme that is now active. */
|
||||
export function applyTheme (theme) {
|
||||
const root = document.documentElement
|
||||
if (root) {
|
||||
root.classList.toggle(DARK_CLASS, theme === 'dark')
|
||||
}
|
||||
notify(theme)
|
||||
return theme
|
||||
}
|
||||
|
||||
/** True when the root element currently carries the dark theme. */
|
||||
export function isDarkTheme () {
|
||||
const root = document.documentElement
|
||||
return Boolean(root && root.classList.contains(DARK_CLASS))
|
||||
}
|
||||
|
||||
/**
|
||||
* Remember the theme so it survives a reload.
|
||||
* A storage failure leaves the theme applied for this page view only.
|
||||
*/
|
||||
export function storeTheme (theme) {
|
||||
try {
|
||||
window.localStorage.setItem(THEME_STORAGE_KEY, theme)
|
||||
} catch {
|
||||
// Storage is unavailable; the theme still applies for this page view.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the stored theme, or the system default, before the app mounts.
|
||||
* Returns the applied theme.
|
||||
*/
|
||||
export function initializeTheme () {
|
||||
const theme = resolveTheme()
|
||||
applyTheme(theme)
|
||||
followSystemTheme()
|
||||
return theme
|
||||
}
|
||||
|
||||
/**
|
||||
* Follow the system preference while no explicit choice is stored.
|
||||
*
|
||||
* The listener applies the new system preference, unless the reader has made
|
||||
* an explicit choice in the meantime: the stored choice always wins.
|
||||
*/
|
||||
function followSystemTheme () {
|
||||
if (typeof window.matchMedia !== 'function') return
|
||||
let query
|
||||
try {
|
||||
query = window.matchMedia(DARK_QUERY)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
if (!query || typeof query.addEventListener !== 'function') return
|
||||
|
||||
const onChange = (event) => {
|
||||
if (readStoredTheme() !== null) return
|
||||
applyTheme(event.matches ? 'dark' : 'light')
|
||||
}
|
||||
|
||||
try {
|
||||
query.addEventListener('change', onChange)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to theme changes. Returns a function that removes the subscriber.
|
||||
* The subscriber is called with the theme that is now active.
|
||||
*/
|
||||
export function onThemeChange (subscriber) {
|
||||
subscribers.add(subscriber)
|
||||
return () => subscribers.delete(subscriber)
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch between the light and the dark theme, remember the choice and
|
||||
* return the theme that is now active.
|
||||
*/
|
||||
export function toggleTheme () {
|
||||
const theme = isDarkTheme() ? 'light' : 'dark'
|
||||
applyTheme(theme)
|
||||
storeTheme(theme)
|
||||
return theme
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
variant: {
|
||||
type: String,
|
||||
default: 'default',
|
||||
validator: (value) => ['default', 'blue', 'purple', 'green', 'amber', 'red', 'cyan'].includes(value)
|
||||
}
|
||||
})
|
||||
|
||||
const variantClasses = {
|
||||
default: 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300',
|
||||
blue: 'bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300',
|
||||
purple: 'bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300',
|
||||
green: 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300',
|
||||
amber: 'bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300',
|
||||
red: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300',
|
||||
cyan: 'bg-cyan-100 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-300'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium"
|
||||
:class="variantClasses[variant]"
|
||||
>
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
@@ -1,39 +0,0 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
hover: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
gradient: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
glow: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="card"
|
||||
:class="{
|
||||
'hover:-translate-y-2': hover,
|
||||
[`shadow-glow-${glow}`]: glow
|
||||
}"
|
||||
>
|
||||
<div v-if="gradient" class="flex items-start gap-5">
|
||||
<div
|
||||
class="icon-box w-14 h-14 rounded-2xl"
|
||||
:class="gradient"
|
||||
>
|
||||
<slot name="icon"></slot>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
<slot v-else></slot>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,41 +0,0 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
})
|
||||
|
||||
const copied = ref(false)
|
||||
const codeRef = ref(null)
|
||||
|
||||
const copyCode = async () => {
|
||||
if (codeRef.value) {
|
||||
const text = codeRef.value.innerText
|
||||
await navigator.clipboard.writeText(text)
|
||||
copied.value = true
|
||||
setTimeout(() => {
|
||||
copied.value = false
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="rounded-xl overflow-hidden bg-gray-900 dark:bg-gray-950">
|
||||
<div v-if="title" class="flex items-center justify-between px-3 sm:px-4 py-2 bg-gray-800 dark:bg-gray-900 border-b border-gray-700">
|
||||
<span class="text-gray-400 text-xs sm:text-sm font-medium truncate mr-2">{{ title }}</span>
|
||||
<button
|
||||
@click="copyCode"
|
||||
class="text-gray-400 hover:text-white transition-colors p-2 min-w-[40px] min-h-[40px] flex items-center justify-center flex-shrink-0"
|
||||
aria-label="Copy code"
|
||||
>
|
||||
<i v-if="copied" class="fas fa-check text-green-400"></i>
|
||||
<i v-else class="fas fa-copy"></i>
|
||||
</button>
|
||||
</div>
|
||||
<pre class="p-3 sm:p-4 overflow-x-auto text-xs sm:text-sm"><code ref="codeRef" class="text-gray-100 font-mono whitespace-pre-wrap break-words sm:whitespace-pre sm:break-normal"><slot></slot></code></pre>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,75 +0,0 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
text: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: 'Copy'
|
||||
},
|
||||
copiedLabel: {
|
||||
type: String,
|
||||
default: 'Copied!'
|
||||
}
|
||||
})
|
||||
|
||||
const copied = ref(false)
|
||||
const error = ref(false)
|
||||
|
||||
const copyToClipboard = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(props.text)
|
||||
copied.value = true
|
||||
error.value = false
|
||||
|
||||
setTimeout(() => {
|
||||
copied.value = false
|
||||
}, 2000)
|
||||
} catch (err) {
|
||||
error.value = true
|
||||
setTimeout(() => {
|
||||
error.value = false
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
@click="copyToClipboard"
|
||||
class="inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200"
|
||||
:class="[
|
||||
copied
|
||||
? 'bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300'
|
||||
: error
|
||||
? 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300'
|
||||
: 'bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700'
|
||||
]"
|
||||
:title="copied ? copiedLabel : label"
|
||||
>
|
||||
<transition name="scale" mode="out-in">
|
||||
<i v-if="copied" key="check" class="fas fa-check"></i>
|
||||
<i v-else-if="error" key="error" class="fas fa-exclamation-circle"></i>
|
||||
<i v-else key="copy" class="fas fa-copy"></i>
|
||||
</transition>
|
||||
<span v-if="copied">{{ copiedLabel }}</span>
|
||||
<span v-else-if="error">Failed</span>
|
||||
<span v-else>{{ label }}</span>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.scale-enter-active,
|
||||
.scale-leave-active {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.scale-enter-from,
|
||||
.scale-leave-to {
|
||||
opacity: 0;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
</style>
|
||||
@@ -1,53 +0,0 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
icon: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
gradient: {
|
||||
type: String,
|
||||
default: 'from-blue-500 to-blue-600'
|
||||
},
|
||||
href: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component
|
||||
:is="href ? 'a' : 'div'"
|
||||
:href="href"
|
||||
class="group card p-6 cursor-pointer"
|
||||
:class="{ 'hover:-translate-y-2': href }"
|
||||
>
|
||||
<div class="flex items-start gap-5">
|
||||
<div
|
||||
class="w-14 h-14 rounded-2xl bg-gradient-to-br flex items-center justify-center flex-shrink-0 transition-all duration-300 group-hover:scale-110 group-hover:rotate-3"
|
||||
:class="gradient"
|
||||
>
|
||||
<i :class="icon" class="text-white text-xl"></i>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<h3 class="font-semibold text-lg text-gray-900 dark:text-gray-100 mb-2 flex items-center gap-2">
|
||||
{{ title }}
|
||||
<i
|
||||
v-if="href"
|
||||
class="fas fa-arrow-right text-sm opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 text-blue-500"
|
||||
></i>
|
||||
</h3>
|
||||
<p v-if="description" class="text-sm text-gray-600 dark:text-gray-400 leading-relaxed">{{ description }}</p>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</component>
|
||||
</template>
|
||||
@@ -1,101 +0,0 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
delay: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
direction: {
|
||||
type: String,
|
||||
default: 'up', // 'up', 'down', 'left', 'right'
|
||||
validator: (value) => ['up', 'down', 'left', 'right'].includes(value)
|
||||
},
|
||||
distance: {
|
||||
type: Number,
|
||||
default: 30
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
default: 600
|
||||
},
|
||||
once: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
threshold: {
|
||||
type: Number,
|
||||
default: 0.1
|
||||
}
|
||||
})
|
||||
|
||||
const elementRef = ref(null)
|
||||
const isVisible = ref(false)
|
||||
|
||||
const getInitialTransform = () => {
|
||||
switch (props.direction) {
|
||||
case 'up': return `translateY(${props.distance}px)`
|
||||
case 'down': return `translateY(-${props.distance}px)`
|
||||
case 'left': return `translateX(${props.distance}px)`
|
||||
case 'right': return `translateX(-${props.distance}px)`
|
||||
default: return `translateY(${props.distance}px)`
|
||||
}
|
||||
}
|
||||
|
||||
let observer = null
|
||||
|
||||
onMounted(() => {
|
||||
if (!elementRef.value) return
|
||||
|
||||
observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
setTimeout(() => {
|
||||
isVisible.value = true
|
||||
}, props.delay)
|
||||
|
||||
if (props.once && observer) {
|
||||
observer.unobserve(entry.target)
|
||||
}
|
||||
} else if (!props.once) {
|
||||
isVisible.value = false
|
||||
}
|
||||
})
|
||||
},
|
||||
{
|
||||
threshold: props.threshold,
|
||||
rootMargin: '0px 0px -50px 0px'
|
||||
}
|
||||
)
|
||||
|
||||
observer.observe(elementRef.value)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (observer && elementRef.value) {
|
||||
observer.unobserve(elementRef.value)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
ref="elementRef"
|
||||
class="scroll-reveal"
|
||||
:class="{ 'is-visible': isVisible }"
|
||||
:style="{
|
||||
opacity: isVisible ? 1 : 0,
|
||||
transform: isVisible ? 'translate(0)' : getInitialTransform(),
|
||||
transition: `opacity ${duration}ms cubic-bezier(0.4, 0, 0.2, 1), transform ${duration}ms cubic-bezier(0.4, 0, 0.2, 1)`
|
||||
}"
|
||||
>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.scroll-reveal {
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
</style>
|
||||
@@ -1,74 +1,51 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
headers: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
rows: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
title: { type: String, default: '' },
|
||||
headers: { type: Array, required: true },
|
||||
rows: { type: Array, required: true }
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="glass rounded-2xl overflow-hidden">
|
||||
<div v-if="title" class="px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50/50 dark:bg-gray-800/50">
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 text-sm sm:text-base">{{ title }}</h3>
|
||||
</div>
|
||||
|
||||
<!-- Mobile card view - shown on small screens -->
|
||||
<div class="block sm:hidden">
|
||||
<div
|
||||
v-for="(row, rowIndex) in rows"
|
||||
:key="rowIndex"
|
||||
class="p-4 border-b border-gray-200 dark:border-gray-700 last:border-b-0 hover:bg-gray-50/50 dark:hover:bg-gray-800/30 transition-colors"
|
||||
>
|
||||
<div
|
||||
v-for="(cell, cellIndex) in row"
|
||||
:key="cellIndex"
|
||||
class="py-1.5"
|
||||
>
|
||||
<span class="text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">{{ headers[cellIndex] }}: </span>
|
||||
<span class="text-sm text-gray-700 dark:text-gray-300" v-html="cell"></span>
|
||||
</div>
|
||||
<div class="border border-border">
|
||||
<h3 v-if="title" class="border-b border-border bg-muted px-4 py-2 text-title font-semibold text-large">
|
||||
{{ title }}
|
||||
</h3>
|
||||
|
||||
<!-- Small screens: one block per row, so the table never scrolls sideways. -->
|
||||
<dl class="divide-y divide-border sm:hidden">
|
||||
<div v-for="(row, rowIndex) in rows" :key="rowIndex" class="px-4 py-3">
|
||||
<template v-for="(cell, cellIndex) in row" :key="cellIndex">
|
||||
<dt class="pt-1 text-body-base font-semibold text-muted-foreground">{{ headers[cellIndex] }}</dt>
|
||||
<dd class="pb-1 text-body-base text-body">{{ cell }}</dd>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Desktop table view - hidden on mobile, shown on sm+ -->
|
||||
<div class="hidden sm:block overflow-x-auto">
|
||||
<table class="w-full">
|
||||
<thead>
|
||||
<tr class="bg-gray-50/80 dark:bg-gray-800/80">
|
||||
<th
|
||||
v-for="header in headers"
|
||||
:key="header"
|
||||
class="px-4 md:px-6 py-3 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider whitespace-nowrap"
|
||||
>
|
||||
{{ header }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
|
||||
<tr
|
||||
v-for="(row, index) in rows"
|
||||
:key="index"
|
||||
class="hover:bg-gray-50/50 dark:hover:bg-gray-800/30 transition-all duration-200 group"
|
||||
</dl>
|
||||
|
||||
<table class="hidden w-full table-auto border-collapse text-left sm:table">
|
||||
<thead>
|
||||
<tr class="bg-muted">
|
||||
<th
|
||||
v-for="header in headers"
|
||||
:key="header"
|
||||
scope="col"
|
||||
class="border-b border-border px-4 py-2 text-body-base font-semibold text-large"
|
||||
>
|
||||
<td
|
||||
v-for="(cell, cellIndex) in row"
|
||||
:key="cellIndex"
|
||||
class="px-4 md:px-6 py-3 md:py-4 text-sm text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
<span v-html="cell" class="group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ header }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, rowIndex) in rows" :key="rowIndex" class="border-b border-border last:border-b-0">
|
||||
<td
|
||||
v-for="(cell, cellIndex) in row"
|
||||
:key="cellIndex"
|
||||
class="break-words px-4 py-2 align-top text-body-base text-body"
|
||||
>
|
||||
{{ cell }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
text: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
default: 'top',
|
||||
validator: (value) => ['top', 'bottom', 'left', 'right'].includes(value)
|
||||
}
|
||||
})
|
||||
|
||||
const show = ref(false)
|
||||
|
||||
const positionClasses = {
|
||||
top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',
|
||||
bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',
|
||||
left: 'right-full top-1/2 -translate-y-1/2 mr-2',
|
||||
right: 'left-full top-1/2 -translate-y-1/2 ml-2'
|
||||
}
|
||||
|
||||
const arrowClasses = {
|
||||
top: 'top-full left-1/2 -translate-x-1/2 -mt-1 border-l-transparent border-r-transparent border-b-transparent',
|
||||
bottom: 'bottom-full left-1/2 -translate-x-1/2 -mb-1 border-l-transparent border-r-transparent border-t-transparent',
|
||||
left: 'left-full top-1/2 -translate-y-1/2 -ml-1 border-t-transparent border-b-transparent border-r-transparent',
|
||||
right: 'right-full top-1/2 -translate-y-1/2 -mr-1 border-t-transparent border-b-transparent border-l-transparent'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="relative inline-block"
|
||||
@mouseenter="show = true"
|
||||
@mouseleave="show = false"
|
||||
@focus="show = true"
|
||||
@blur="show = false"
|
||||
>
|
||||
<slot></slot>
|
||||
|
||||
<transition
|
||||
enter-active-class="transition duration-200 ease-out"
|
||||
enter-from-class="opacity-0 scale-95"
|
||||
enter-to-class="opacity-100 scale-100"
|
||||
leave-active-class="transition duration-150 ease-in"
|
||||
leave-from-class="opacity-100 scale-100"
|
||||
leave-to-class="opacity-0 scale-95"
|
||||
>
|
||||
<div
|
||||
v-if="show"
|
||||
:class="[
|
||||
'absolute z-50 px-3 py-2 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-lg shadow-lg whitespace-nowrap pointer-events-none',
|
||||
positionClasses[position]
|
||||
]"
|
||||
role="tooltip"
|
||||
>
|
||||
{{ text }}
|
||||
<div
|
||||
:class="[
|
||||
'absolute w-2 h-2 bg-gray-900 dark:bg-gray-700 rotate-45 border-4 border-gray-900 dark:border-gray-700',
|
||||
arrowClasses[position]
|
||||
]"
|
||||
></div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
@@ -3,28 +3,28 @@ export const assessmentCategories = [
|
||||
id: 'focus',
|
||||
title: 'Focus & Deep Work',
|
||||
icon: 'fas fa-brain',
|
||||
gradient: 'from-blue-500 to-cyan-500',
|
||||
gradient: 'bg-accent text-accent-foreground',
|
||||
color: 'blue'
|
||||
},
|
||||
{
|
||||
id: 'communication',
|
||||
title: 'Communication',
|
||||
icon: 'fas fa-comments',
|
||||
gradient: 'from-purple-500 to-pink-500',
|
||||
gradient: 'bg-accent text-accent-foreground',
|
||||
color: 'purple'
|
||||
},
|
||||
{
|
||||
id: 'autonomy',
|
||||
title: 'Autonomy & Trust',
|
||||
icon: 'fas fa-user-shield',
|
||||
gradient: 'from-green-500 to-emerald-500',
|
||||
gradient: 'bg-accent text-accent-foreground',
|
||||
color: 'green'
|
||||
},
|
||||
{
|
||||
id: 'sustainability',
|
||||
title: 'Sustainability',
|
||||
icon: 'fas fa-leaf',
|
||||
gradient: 'from-amber-500 to-orange-500',
|
||||
gradient: 'bg-accent text-accent-foreground',
|
||||
color: 'amber'
|
||||
}
|
||||
]
|
||||
@@ -34,7 +34,7 @@ export const assessmentQuestions = [
|
||||
{
|
||||
id: 1,
|
||||
category: 'focus',
|
||||
question: 'How often do you get uninterrupted blocks of 2+ hours for focused work?',
|
||||
question: 'How often do you get uninterrupted blocks of 2+ hours for focused work? BEAT sets the daily focus block at 4 hours — a BEAT default, not a research finding.',
|
||||
options: [
|
||||
{ value: 1, label: 'Rarely or never', description: 'Constant interruptions throughout the day' },
|
||||
{ value: 2, label: 'Sometimes', description: 'Maybe once or twice a week' },
|
||||
@@ -84,7 +84,7 @@ export const assessmentQuestions = [
|
||||
options: [
|
||||
{ value: 1, label: 'Immediate', description: 'Expected to respond within minutes' },
|
||||
{ value: 2, label: 'Within hours', description: 'Same-day responses expected' },
|
||||
{ value: 3, label: 'Within a day', description: '24-hour response is acceptable' },
|
||||
{ value: 3, label: 'Within a day', description: '24 working hours — a BEAT default, listed in the constraints table' },
|
||||
{ value: 4, label: 'Async-friendly', description: 'Response when working, no pressure' }
|
||||
]
|
||||
},
|
||||
@@ -166,7 +166,7 @@ export const assessmentQuestions = [
|
||||
{ value: 1, label: 'No', description: 'Always feature work' },
|
||||
{ value: 2, label: 'Personal time only', description: 'Learning is on your own time' },
|
||||
{ value: 3, label: 'Sometimes', description: 'When we have slack' },
|
||||
{ value: 4, label: 'Protected time', description: '20% for exploration built in' }
|
||||
{ value: 4, label: 'Protected time', description: '20% of working time for exploration — a BEAT default, listed in the constraints table' }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -175,25 +175,25 @@ export const beatRecommendations = {
|
||||
focus: {
|
||||
low: {
|
||||
title: 'Your Focus is Under Attack',
|
||||
description: 'Constant interruptions and meetings are destroying your team\'s ability to do deep work. Research shows it takes 52 minutes to reach focus and 23 minutes to recover from interruption.',
|
||||
description: 'Constant interruptions and meetings are undermining your team\'s ability to do deep work. Resuming interrupted work takes about twenty-five minutes [mark-2005], and the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014].',
|
||||
recommendations: [
|
||||
'Establish 4-hour daily sacred blocks where no meetings or interruptions are allowed',
|
||||
'Limit meetings to 2 hours per week maximum',
|
||||
'Establish 4-hour daily sacred blocks where no meetings or interruptions are allowed — a BEAT default, listed in the constraints table',
|
||||
'Limit meetings to 2 hours per week maximum — a BEAT default, listed in the constraints table',
|
||||
'Measure outcomes, not hours worked or time online',
|
||||
'Let makers choose when their focus time occurs'
|
||||
],
|
||||
beatPrinciple: 'Protect the focus state above all else. The uninterrupted mind produces the best work.'
|
||||
beatPrinciple: 'Protect the focus state above all else. Sacred blocks come first, because everything else in the plan depends on them.'
|
||||
},
|
||||
medium: {
|
||||
title: 'Focus Needs Protection',
|
||||
description: 'You have some focus time, but it\'s inconsistent. With more structure, your team could dramatically increase productivity.',
|
||||
description: 'You have some focus time, but it\'s inconsistent. With more structure, your team could recover time that interruptions now take from it.',
|
||||
recommendations: [
|
||||
'Formalize sacred blocks and make them non-negotiable',
|
||||
'Audit your meeting calendar - can 50% become async?',
|
||||
'Audit your meeting calendar - can half of it become async?',
|
||||
'Create clear signals for when someone is in focus mode',
|
||||
'Track interruption patterns and address the sources'
|
||||
],
|
||||
beatPrinciple: 'Presence does not equal productivity. A maker in focus for four hours outproduces a maker in meetings for eight.'
|
||||
beatPrinciple: 'Presence does not equal productivity. We do not measure hours worked or time online. We measure outcomes delivered.'
|
||||
},
|
||||
high: {
|
||||
title: 'Strong Focus Culture',
|
||||
@@ -213,7 +213,7 @@ export const beatRecommendations = {
|
||||
description: 'Without written documentation and async practices, knowledge is lost, decisions are forgotten, and everyone stays chained to chat.',
|
||||
recommendations: [
|
||||
'Adopt a "write first" policy for all decisions',
|
||||
'Set expectation: responses within 24 working hours, not minutes',
|
||||
'Set expectation: responses within 24 working hours, not minutes — a BEAT default, listed in the constraints table',
|
||||
'Create clear channels: urgent = phone, everything else waits',
|
||||
'Replace daily standups with written async check-ins'
|
||||
],
|
||||
@@ -282,9 +282,9 @@ export const beatRecommendations = {
|
||||
title: 'Burnout Risk is High',
|
||||
description: 'Regular overtime and no time for learning is a recipe for burnout, turnover, and declining quality.',
|
||||
recommendations: [
|
||||
'Plan at 80% capacity, leaving slack for life',
|
||||
'Plan at 80% capacity, leaving slack for life — a BEAT default, listed in the constraints table',
|
||||
'When deadlines conflict, cut scope—never cut rest',
|
||||
'Protect 20% time for learning and exploration',
|
||||
'Protect 20% time for learning and exploration — a BEAT default, listed in the constraints table',
|
||||
'Make overtime a red flag, not a badge of honor'
|
||||
],
|
||||
beatPrinciple: 'Sustainable pace is not optional. Overtime is a red flag, not a badge of honor.'
|
||||
@@ -295,7 +295,7 @@ export const beatRecommendations = {
|
||||
recommendations: [
|
||||
'Track overtime patterns and address root causes',
|
||||
'Formally protect exploration time',
|
||||
'Review capacity planning—are you over 80%?',
|
||||
'Review capacity planning—are you over 80% of your working time? (a BEAT default, listed in the constraints table)',
|
||||
'Watch for burnout warning signs'
|
||||
],
|
||||
beatPrinciple: 'The team\'s health is the Enabler\'s responsibility. Someone must watch for warning signs.'
|
||||
@@ -315,12 +315,30 @@ export const beatRecommendations = {
|
||||
}
|
||||
|
||||
export const overallAssessment = {
|
||||
scoring: {
|
||||
id: 'assessment-scoring',
|
||||
maxScore: 48,
|
||||
questionCount: 12,
|
||||
perQuestionMax: 4,
|
||||
categoryThresholds: 'BEAT\'s own scoring rule, not a research finding: a category is low below 40 percent of that category\'s own maximum, medium from 40 to 70 percent of it, and high above 70 percent. The four overall bands are a separate BEAT choice, stated as absolute score ranges out of 48, and are not produced by those two percentage cuts: low 12 to 24, medium 25 to 36, strong 37 to 42, high 43 to 48.',
|
||||
bandCuts: [
|
||||
{ range: [12, 24], title: 'Significant Opportunity for Improvement' },
|
||||
{ range: [25, 36], title: 'Building Better Practices' },
|
||||
{ range: [37, 42], title: 'Strong Foundation' },
|
||||
{ range: [43, 48], title: 'BEAT-Ready Team' }
|
||||
],
|
||||
derivation: 'The category cuts are percentages of one category maximum, 12 points per category. The overall bands are absolute score ranges out of 48, listed in the order the bands appear under overallAssessment. BEAT\'s own choice, not a research finding, and not derived from the category cuts.'
|
||||
},
|
||||
validity: {
|
||||
id: 'assessment-validity',
|
||||
note: 'This is a self-report with no published validity evidence. It measures what a team believes about its own practice, not delivery, quality or wellbeing. Use it to start a conversation and to compare your own score over time, not as a benchmark against other teams.'
|
||||
},
|
||||
struggling: {
|
||||
range: [12, 24],
|
||||
title: 'Significant Opportunity for Improvement',
|
||||
icon: 'fas fa-exclamation-triangle',
|
||||
color: 'red',
|
||||
description: 'Your team faces significant challenges that BEAT is designed to solve. The good news: there\'s tremendous potential for improvement.',
|
||||
description: 'Your team faces significant challenges that BEAT is designed to address. The good news: there is room for real improvement here.',
|
||||
callToAction: 'Start with the biggest pain point. Small changes compound over time.'
|
||||
},
|
||||
developing: {
|
||||
@@ -328,7 +346,7 @@ export const overallAssessment = {
|
||||
title: 'Building Better Practices',
|
||||
icon: 'fas fa-seedling',
|
||||
color: 'amber',
|
||||
description: 'Your team has some good foundations but inconsistent practices. BEAT can provide the structure to level up.',
|
||||
description: 'Your team has some good foundations but inconsistent practices. BEAT can provide the structure to build on them.',
|
||||
callToAction: 'Focus on making existing good practices consistent and documented.'
|
||||
},
|
||||
strong: {
|
||||
@@ -344,7 +362,7 @@ export const overallAssessment = {
|
||||
title: 'BEAT-Ready Team',
|
||||
icon: 'fas fa-star',
|
||||
color: 'green',
|
||||
description: 'Congratulations! Your team is already aligned with BEAT principles. Consider adopting the framework formally.',
|
||||
callToAction: 'You\'re ready to fully adopt BEAT and become ambassadors for these practices.'
|
||||
description: 'Your team is already aligned with BEAT principles. Consider adopting the framework formally.',
|
||||
callToAction: 'You\'re ready to adopt BEAT fully and to teach these practices to others.'
|
||||
}
|
||||
}
|
||||
|
||||
+440
-63
@@ -4,109 +4,118 @@ export const coreValues = [
|
||||
{ valueMore: 'Written documentation', over: 'Verbal agreements', icon: 'fas fa-file-alt' },
|
||||
{ valueMore: 'Individual autonomy', over: 'Prescribed processes', icon: 'fas fa-user-check' },
|
||||
{ valueMore: 'Sustainable pace', over: 'Heroic effort', icon: 'fas fa-heart' },
|
||||
{ valueMore: 'Small experiments', over: 'Perfect plans', icon: 'fas fa-flask' }
|
||||
{ valueMore: 'Small experiments', over: 'Careful plans', icon: 'fas fa-flask' }
|
||||
]
|
||||
|
||||
export const teamValues = [
|
||||
{
|
||||
name: 'Trust',
|
||||
icon: 'fas fa-handshake',
|
||||
gradient: 'from-blue-500 to-blue-600',
|
||||
gradient: 'bg-accent text-accent-foreground',
|
||||
description: 'We assume competence and good intent. We give autonomy because we trust it will be used well. We share information openly because we trust it will be handled responsibly.'
|
||||
},
|
||||
{
|
||||
name: 'Courage',
|
||||
icon: 'fas fa-shield-alt',
|
||||
gradient: 'from-purple-500 to-purple-600',
|
||||
gradient: 'bg-foreground text-background',
|
||||
description: 'We speak up when something is wrong. We admit when we don\'t know. We challenge decisions respectfully. We try new approaches even when they might fail.'
|
||||
},
|
||||
{
|
||||
name: 'Candor',
|
||||
icon: 'fas fa-comments',
|
||||
gradient: 'from-cyan-500 to-cyan-600',
|
||||
gradient: 'bg-muted-foreground text-background',
|
||||
description: 'We give honest feedback, kindly delivered. We say what we mean in writing. We surface problems early rather than hiding them. We disagree openly, then commit.'
|
||||
},
|
||||
{
|
||||
name: 'Ownership',
|
||||
icon: 'fas fa-flag',
|
||||
gradient: 'from-green-500 to-green-600',
|
||||
gradient: 'bg-muted text-foreground',
|
||||
description: 'We take responsibility for our work and its impact. We don\'t wait to be told. We fix what we find broken. We see things through to done.'
|
||||
},
|
||||
{
|
||||
name: 'Calm',
|
||||
icon: 'fas fa-spa',
|
||||
gradient: 'from-amber-500 to-amber-600',
|
||||
gradient: 'bg-muted text-foreground',
|
||||
description: 'We do not create urgency where none exists. We respond thoughtfully, not reactively. We protect each other\'s focus. We choose sustainable over heroic.'
|
||||
}
|
||||
]
|
||||
|
||||
// Stable ids for the four principle groups. The README side uses the same ids
|
||||
// so a section can be matched across both mirrors.
|
||||
export const principleSections = [
|
||||
{ id: 'principle-focus', key: 'focus', title: 'On Focus', number: '1-3' },
|
||||
{ id: 'principle-communication', key: 'communication', title: 'On Communication', number: '4-6' },
|
||||
{ id: 'principle-autonomy', key: 'autonomy', title: 'On Autonomy', number: '7-9' },
|
||||
{ id: 'principle-sustainability', key: 'sustainability', title: 'On Sustainability', number: '10-12' }
|
||||
]
|
||||
|
||||
export const principles = {
|
||||
focus: [
|
||||
{
|
||||
number: 1,
|
||||
title: 'Protect the focus state above all else',
|
||||
description: 'The uninterrupted mind produces the best work. We maintain sacred blocks of four hours daily where no meetings, messages, or interruptions are permitted. The maker chooses when this time occurs.'
|
||||
description: 'Sacred blocks come first, because everything else in the plan depends on them. A maker protects a focus block of four hours each working day — a BEAT default, listed in the constraints table — and chooses when it falls. The only exception is a declared production incident: the incident lead may suspend a block, and only for the time the incident runs.'
|
||||
},
|
||||
{
|
||||
number: 2,
|
||||
title: 'Interruptions are not free',
|
||||
description: 'Research shows 52 minutes to reach deep focus, 23 minutes to recover from interruption. Every "quick question" costs more than it appears. Default to async. Wait for the open window.'
|
||||
description: 'Interrupting someone costs more than the question appears to. Resuming interrupted work takes about twenty-five minutes [mark-2005], and the most productive users tracked by DeskTime worked in blocks of fifty-two minutes [desktime-2014]. So we default to async and wait for the open window.'
|
||||
},
|
||||
{
|
||||
number: 3,
|
||||
title: 'Presence does not equal productivity',
|
||||
description: 'We do not measure hours worked or time online. We measure outcomes delivered. A maker in focus for four hours outproduces a maker in meetings for eight.'
|
||||
description: 'We do not measure hours worked or time online. We measure outcomes delivered. Presence is not evidence of output, so a maker is judged by what ships, not by hours spent in meetings.'
|
||||
}
|
||||
],
|
||||
communication: [
|
||||
{
|
||||
number: 4,
|
||||
title: 'Writing is thinking made visible',
|
||||
description: 'We write by default. Decisions not documented did not happen. Written words can be searched, referenced, and shared across time zones. They outlive the meeting that never was.'
|
||||
description: 'We write by default. A decision counts only when it is written down and the record names who decided it — silence is not consent. Written words can be searched, referenced, and shared across time zones. They outlive the meeting that never was.'
|
||||
},
|
||||
{
|
||||
number: 5,
|
||||
title: 'Synchronous time is expensive. Spend it wisely',
|
||||
description: 'Meetings cost everyone present, simultaneously. We limit them to two hours per week, one hour maximum each. If it can be written, write it. If it must be discussed, write first, then discuss the delta.'
|
||||
description: 'Meetings cost everyone present, simultaneously, and the people who need the room most are rarely in it. Surveyed knowledge workers reported lower productivity above two hours a day in meetings [slack-workplace-lab-2017]. We limit meetings to the budget in the constraints table, one hour maximum each, and a declared incident is the only exception. If it can be written, write it; if it must be discussed, write first, then discuss the delta.'
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
title: 'Response time is not reaction time',
|
||||
description: 'Async means responding when working, not responding immediately. We expect responses within 24 working hours. Urgent means phone call. Everything else waits.'
|
||||
description: 'Async means responding when working, not responding immediately. We expect a response within 24 working hours — the BEAT default, listed in the constraints table — counted against the coverage hours in the time-zone rules. Urgent means a phone call to the on-call rota, and the rota names the fallback when nobody answers. Everything else waits.'
|
||||
}
|
||||
],
|
||||
autonomy: [
|
||||
{
|
||||
number: 7,
|
||||
title: 'Trust makers to make',
|
||||
description: 'Those who build the thing decide how to build it. They choose their tools, their approach, their schedule, their collaborators. We provide goals and constraints, not instructions.'
|
||||
description: 'Those who build the thing decide how to build it. They choose their tools, their approach, their schedule, their collaborators. Method is the maker\'s. The done condition is the team\'s, and a maker who cannot meet one raises it before the work starts, not after. We give makers autonomy because autonomy, competence and relatedness are the needs that make sustained motivation possible [deci-ryan-2000] — a general motivation finding, not a result about developers. We provide goals and constraints, not instructions.'
|
||||
},
|
||||
{
|
||||
number: 8,
|
||||
title: 'Pull, don\'t push',
|
||||
description: 'Work is not assigned. Work is pulled by those with capacity and interest. Makers select from a prioritized stack. They may skip with reason. They may propose alternatives.'
|
||||
description: 'Work is not assigned. Work is pulled by those with capacity and interest. The Enabler orders the stack — priority and order, never assignment — and makers pull from the top of it. A maker may skip an item with a reason, propose an alternative, and object to the order through the dispute path in the priority rules.'
|
||||
},
|
||||
{
|
||||
number: 9,
|
||||
title: 'The maker\'s "no" is valid',
|
||||
description: 'Makers may refuse work that is unethical, impossible, or poorly conceived. They may challenge priorities. They may push back on requirements. This is not insubordination—it is ownership.'
|
||||
description: 'Makers may refuse work that is unethical, impossible, or poorly conceived. They may challenge priorities. They may push back on requirements. A refusal is a decision and is recorded like any other: this is not insubordination—it is ownership.'
|
||||
}
|
||||
],
|
||||
sustainability: [
|
||||
{
|
||||
number: 10,
|
||||
title: 'Sustainable pace is not optional',
|
||||
description: 'Overtime is a red flag, not a badge of honor. When deadlines conflict with capacity, we cut scope. We never cut rest. Burnout destroys teams. Recovery is productive. We plan at 80% and leave slack for life.'
|
||||
description: 'Overtime is a red flag, not a badge of honor. When deadlines conflict with capacity, we cut scope and we never cut rest. The capacity plan belongs to the Enabler, is set per maker for each beat at eighty percent of that maker\'s available working time, and says what does not fit. When a NOW item would break the plan, the deadline moves before the rest does.'
|
||||
},
|
||||
{
|
||||
number: 11,
|
||||
title: 'The team\'s health is the Enabler\'s responsibility',
|
||||
description: 'Someone must watch for warning signs: maxed WIP, skipped check-ins, overtime patterns, withdrawal. Someone must shield the team from organizational noise. Someone must say "no" to protect "yes."'
|
||||
description: 'Someone must watch for warning signs: maxed WIP, skipped check-ins, overtime patterns, withdrawal. Someone must shield the team from organizational noise. Someone must say "no" to protect "yes." That someone is the Enabler, and the thresholds behind each warning sign are listed with the measurement rules.'
|
||||
},
|
||||
{
|
||||
number: 12,
|
||||
title: 'Exploration time is not a reward. It is a requirement',
|
||||
description: 'Twenty percent of time belongs to the maker for learning, tooling, experiments, and interests. No justification required. No approval needed. This is how we stay sharp. This is how we find better ways.'
|
||||
description: 'A fifth of each maker\'s working time belongs to learning, tooling, experiments, and interests — a BEAT default, listed in the constraints table. No justification required. No approval needed. Exploration does not consume a work-in-progress slot and does not sit on the board: it is scheduled, not tracked as work.'
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -115,19 +124,19 @@ export const roles = [
|
||||
{
|
||||
name: 'The Maker',
|
||||
icon: 'fas fa-hammer',
|
||||
gradient: 'from-blue-500 to-blue-600',
|
||||
description: 'Builds things. They have full autonomy over implementation. They pull work, propose solutions, review code, and surface blockers. They choose what, how, when, where, and with whom.'
|
||||
gradient: 'bg-accent text-accent-foreground',
|
||||
description: 'Builds things. They have full autonomy over implementation. They pull work, propose solutions, review code, and surface blockers. They choose what, how, when, where, and with whom. The done condition is the team\'s, not theirs to change alone.'
|
||||
},
|
||||
{
|
||||
name: 'The Enabler',
|
||||
icon: 'fas fa-hands-helping',
|
||||
gradient: 'from-purple-500 to-purple-600',
|
||||
description: 'Removes obstacles. They maintain the priority stack, shield from interruptions, monitor wellbeing, and facilitate decisions. They do not dictate—they enable.'
|
||||
gradient: 'bg-foreground text-background',
|
||||
description: 'Removes obstacles. They order the priority stack, shield from interruptions, monitor wellbeing, and facilitate decisions. They do not dictate—they enable: they set order and capacity, never assignment. They plan capacity at the level in the measurement rules. When they are a party to a dispute, they step out of it.'
|
||||
},
|
||||
{
|
||||
name: 'The Connector',
|
||||
icon: 'fas fa-project-diagram',
|
||||
gradient: 'from-cyan-500 to-cyan-600',
|
||||
gradient: 'bg-muted-foreground text-background',
|
||||
description: 'Maintains knowledge flow. They keep documentation current, ensure context flows between makers, and onboard new members. This role is optional and may rotate.'
|
||||
}
|
||||
]
|
||||
@@ -136,12 +145,12 @@ export const priorityBuckets = [
|
||||
{
|
||||
name: 'NOW',
|
||||
color: 'red',
|
||||
description: 'Critical, blocking, time-sensitive. Maximum five items.'
|
||||
description: 'Critical, blocking, time-sensitive. Maximum five items — a BEAT default, listed in the constraints table. When the bucket needs more than the capacity plan allows, the plan wins: the deadline moves or the scope shrinks.'
|
||||
},
|
||||
{
|
||||
name: 'NEXT',
|
||||
color: 'amber',
|
||||
description: 'High value for this beat. An ordered stack. Pull from top.'
|
||||
description: 'High value for this beat. An ordered stack. Pull from top. The order is the Enabler\'s to set; any maker may dispute it through the priority rules.'
|
||||
},
|
||||
{
|
||||
name: 'LATER',
|
||||
@@ -174,34 +183,173 @@ export const ceremonies = [
|
||||
{
|
||||
name: 'Brainstorm',
|
||||
duration: '≤1 hr',
|
||||
purpose: 'Creative solving, with 10-minute exit window'
|
||||
purpose: 'Creative solving, with a 10-minute exit window — a BEAT default, not a research finding'
|
||||
}
|
||||
]
|
||||
|
||||
// Every limit below is a BEAT default chosen by the BEAT authors. None of them
|
||||
// is a research finding; the cited research in the manifesto informs the
|
||||
// direction, not these numbers.
|
||||
export const constraints = [
|
||||
{ constraint: 'Sacred block', limit: '4 hours daily' },
|
||||
{ constraint: 'Meetings per week', limit: '≤2 hours total' },
|
||||
{ constraint: 'Meeting duration', limit: '≤1 hour each' },
|
||||
{ constraint: 'WIP per maker', limit: '3 items' },
|
||||
{ constraint: 'Planning capacity', limit: '80%' },
|
||||
{ constraint: 'Exploration time', limit: '20% (1 day/beat)' },
|
||||
{ constraint: 'NOW items', limit: 'Max 3-5' },
|
||||
{ constraint: 'Review response', limit: '4 hours' },
|
||||
{ constraint: 'Auto-proceed', limit: '24 hours' }
|
||||
{ constraint: 'Planning capacity', limit: '80% of available working time' },
|
||||
{ constraint: 'Exploration time', limit: '20% of working time' },
|
||||
{ constraint: 'NOW items', limit: 'Max 5' },
|
||||
{ constraint: 'Review response', limit: '4 working hours' },
|
||||
{ constraint: 'Auto-proceed', limit: '24 working hours' }
|
||||
]
|
||||
|
||||
// The framework section, keyed for the README mirror.
|
||||
export const framework = {
|
||||
id: 'section-method',
|
||||
title: 'The Framework',
|
||||
summary: 'The principles above guide us. The framework below implements them.',
|
||||
subsections: [
|
||||
'Roles',
|
||||
'Beats',
|
||||
'Work Items',
|
||||
'Definition of Done',
|
||||
'Prioritization',
|
||||
'The Board',
|
||||
'Meetings',
|
||||
'Daily Check-in',
|
||||
'Collaboration',
|
||||
'Multi-Maker Work',
|
||||
'Avoiding Chokepoints',
|
||||
'Spotted Issues',
|
||||
'Burnout Prevention',
|
||||
'Customer & User Feedback',
|
||||
'Incidents & Emergencies',
|
||||
'Technical Practices (Optional)',
|
||||
'On-call and incident rotation',
|
||||
'Working across time zones',
|
||||
'Dependencies across teams',
|
||||
'Accountability and measurement',
|
||||
'Onboarding to BEAT'
|
||||
]
|
||||
}
|
||||
|
||||
// Section and principle ids, mapped to the site data key that holds them and
|
||||
// to the heading each side uses. This is the data-side half of the committed
|
||||
// section mapping: the README mirror and the consistency check read the same
|
||||
// ids from here.
|
||||
export const sectionMap = [
|
||||
...principleSections.map((s) => ({ id: s.id, heading: s.title, dataKey: `principles.${s.key}` })),
|
||||
{ id: 'section-method', heading: 'The Framework', dataKey: 'framework' },
|
||||
{ id: 'onCall', heading: 'On-call and incident rotation', dataKey: 'onCall' },
|
||||
{ id: 'timeZones', heading: 'Working across time zones', dataKey: 'timeZones' },
|
||||
{ id: 'crossTeamDependencies', heading: 'Dependencies across teams', dataKey: 'crossTeamDependencies' },
|
||||
{ id: 'measurement', heading: 'Accountability and measurement', dataKey: 'measurement' },
|
||||
{ id: 'customerFeedback', heading: 'Customer & User Feedback', dataKey: 'customerFeedback' },
|
||||
{ id: 'onboarding', heading: 'Onboarding to BEAT', dataKey: 'onboarding' },
|
||||
{ id: 'assessment-scoring', heading: 'Assessment scoring', dataKey: 'overallAssessment.scoring' },
|
||||
{ id: 'assessment-validity', heading: 'Assessment validity', dataKey: 'overallAssessment.validity' }
|
||||
]
|
||||
|
||||
// Every rule states what it applies to, who decides, and what to do when it
|
||||
// does not fit. The views render this list by iteration.
|
||||
export const decisionRules = [
|
||||
{
|
||||
rule: 'Sacred block',
|
||||
appliesTo: 'Every maker, every working day.',
|
||||
decidedBy: 'The maker chooses the time; the Enabler protects it.',
|
||||
ifItDoesNotFit: 'A declared production incident. The incident lead suspends the block and says when it resumes.'
|
||||
},
|
||||
{
|
||||
rule: 'Meeting budget',
|
||||
appliesTo: 'Recurring and scheduled meetings inside a working week.',
|
||||
decidedBy: 'The Enabler schedules; the meeting is cancelled without an agenda.',
|
||||
ifItDoesNotFit: 'A declared incident, which the incident lead runs outside the budget. Ad-hoc help and a blocked work item count against the same budget.'
|
||||
},
|
||||
{
|
||||
rule: 'Work-in-progress limit',
|
||||
appliesTo: 'Items a maker has started and not finished.',
|
||||
decidedBy: 'The maker, who stops taking new work at the limit.',
|
||||
ifItDoesNotFit: 'The maker is blocked and every remaining item is blocked too. They say so in the check-in and the Enabler unblocks or reorders.'
|
||||
},
|
||||
{
|
||||
rule: 'NOW bucket limit',
|
||||
appliesTo: 'The NOW bucket of the board.',
|
||||
decidedBy: 'The Enabler, who returns items to NEXT to keep the bucket inside its limit.',
|
||||
ifItDoesNotFit: 'A genuine critical item. The Enabler records it, names the deadline it displaces, and the displaced deadline moves.'
|
||||
},
|
||||
{
|
||||
rule: 'Planning capacity',
|
||||
appliesTo: 'The capacity plan for one beat, per maker.',
|
||||
decidedBy: 'The Enabler, at eighty percent of the maker\'s available working time.',
|
||||
ifItDoesNotFit: 'Demand above capacity. The Enabler lists what does not fit and the team decides what moves.'
|
||||
},
|
||||
{
|
||||
rule: 'Exploration time',
|
||||
appliesTo: 'Each maker\'s working time.',
|
||||
decidedBy: 'The maker, without approval.',
|
||||
ifItDoesNotFit: 'Nothing. Exploration time is not traded away when the team is busy; it is moved to the next beat and that is recorded.'
|
||||
},
|
||||
{
|
||||
rule: 'Stale-item sweep',
|
||||
appliesTo: 'Board items with no activity for five working days.',
|
||||
decidedBy: 'The Enabler sweeps at each beat close.',
|
||||
ifItDoesNotFit: 'An item that is intentionally parked. The maker pins it, the pin is reviewed at the next beat close, and an unpinned item returns to the backlog.'
|
||||
},
|
||||
{
|
||||
rule: 'Review response',
|
||||
appliesTo: 'An open pull request, within the coverage hours of the reference time zone.',
|
||||
decidedBy: 'Any maker who reviews; nobody is the assigned reviewer.',
|
||||
ifItDoesNotFit: 'A change with security, data-migration or billing impact, and a change to a dependency other teams consume. These wait for a named reviewer and never auto-proceed.'
|
||||
},
|
||||
{
|
||||
rule: 'Auto-proceed',
|
||||
appliesTo: 'An open pull request past the review response window, with a passing build.',
|
||||
decidedBy: 'The author merges, or asks the Enabler to merge, once the window closes.',
|
||||
ifItDoesNotFit: 'Open review comments. The author answers them or asks for a named reviewer. Exceptions in the review rule never auto-proceed.'
|
||||
},
|
||||
{
|
||||
rule: 'Sizing',
|
||||
appliesTo: 'Team-internal planning of work items.',
|
||||
decidedBy: 'The maker who picks the item.',
|
||||
ifItDoesNotFit: 'A team that must report to an external programme, a regulator or a regulated customer keeps that reporting obligation and adapts the method around it.'
|
||||
},
|
||||
{
|
||||
rule: 'Claiming files',
|
||||
appliesTo: 'Files a maker is changing on a shared branch.',
|
||||
decidedBy: 'The maker, in the branch protection rule before starting.',
|
||||
ifItDoesNotFit: 'Two makers claim the same file. The earlier claim stands and the later maker re-plans around the file.'
|
||||
},
|
||||
{
|
||||
rule: 'Decisions',
|
||||
appliesTo: 'Every decision that changes what the team does.',
|
||||
decidedBy: 'The owner named in the written recommendation.',
|
||||
ifItDoesNotFit: 'Nobody objects within 24 working hours — a BEAT default, not a research finding — and the decision is recorded. An objection moves it to a short synchronous discussion and the owner decides.'
|
||||
},
|
||||
{
|
||||
rule: 'Done condition',
|
||||
appliesTo: 'Every item the team takes on.',
|
||||
decidedBy: 'The team, which owns the definition and records any change to it.',
|
||||
ifItDoesNotFit: 'A maker cannot meet a condition. They raise it before the work starts; the team either changes the condition or the work does not start.'
|
||||
},
|
||||
{
|
||||
rule: 'Technical practices',
|
||||
appliesTo: 'One repository or service, adopted by the team that owns it.',
|
||||
decidedBy: 'The team that owns the code.',
|
||||
ifItDoesNotFit: 'A practice only partly applies, for example automated testing on a codebase with no test harness. The team adopts the part that applies and writes down the part it defers.'
|
||||
}
|
||||
]
|
||||
|
||||
export const definitionOfDone = {
|
||||
code: [
|
||||
'Code works as intended',
|
||||
'Tests pass (existing and new where appropriate)',
|
||||
'Code reviewed by at least one other maker',
|
||||
'Tests pass: the existing suite passes, and new behaviour carries a test unless the team has agreed an exception for it, which the Enabler records',
|
||||
'Code reviewed by at least one other maker, or auto-proceeded under the review rule with the exceptions in that rule named in the merge',
|
||||
'Merged to main branch',
|
||||
'Deployable (or deployed, depending on team practice)',
|
||||
'No known defects introduced'
|
||||
'Deployable: the artefact builds and runs for the team\'s own use, and is deployed where the team deploys its own work',
|
||||
'No known defects introduced: a defect found during the work and logged as its own item does not block this one, provided it is recorded before the merge'
|
||||
],
|
||||
nonCode: [
|
||||
'Meets the stated "done when" condition',
|
||||
'Reviewed by relevant party if needed',
|
||||
'Reviewed by the relevant party where the item names one; where it names none, the maker decides',
|
||||
'Documented where others can find it'
|
||||
]
|
||||
}
|
||||
@@ -226,7 +374,7 @@ export const antiPatterns = {
|
||||
{
|
||||
pattern: 'Permanent NOW',
|
||||
looksLike: 'Everything is urgent, always',
|
||||
fix: 'If everything is NOW, nothing is'
|
||||
fix: 'If everything is NOW, nothing is. The Enabler returns items to NEXT until the bucket is inside its limit'
|
||||
},
|
||||
{
|
||||
pattern: 'Grooming creep',
|
||||
@@ -258,7 +406,7 @@ export const antiPatterns = {
|
||||
{
|
||||
pattern: 'Review blocking',
|
||||
looksLike: 'PRs languish waiting for "the" reviewer',
|
||||
fix: 'Anyone can review, auto-proceed rule'
|
||||
fix: 'Anyone can review, auto-proceed rule, with the exceptions in the review rule'
|
||||
},
|
||||
{
|
||||
pattern: 'Passive Enabler',
|
||||
@@ -275,7 +423,7 @@ export const antiPatterns = {
|
||||
{
|
||||
pattern: 'Stealth deadlines',
|
||||
looksLike: 'Surprise "we promised client by Friday"',
|
||||
fix: 'Surface commitments before making them'
|
||||
fix: 'Surface commitments before making them. A commitment already made outside the team is renegotiated by whoever made it, with the Enabler helping, and the team hears about it before the next beat starts'
|
||||
},
|
||||
{
|
||||
pattern: 'Metric theater',
|
||||
@@ -291,14 +439,16 @@ export const antiPatterns = {
|
||||
}
|
||||
|
||||
export const onboarding = {
|
||||
id: 'onboarding',
|
||||
weekOne: {
|
||||
title: 'Week One: Observe',
|
||||
items: [
|
||||
'Read this manifesto',
|
||||
'Read the decision log, the architecture notes and the board history for the area you join',
|
||||
'Shadow async check-ins and board activity',
|
||||
'Observe one Beat Start and/or Beat Close',
|
||||
'Get access to tools, repos, docs',
|
||||
'Meet team members 1:1 (async or sync, their preference)'
|
||||
'Meet team members one to one: the Connector or the Enabler arranges it, you choose the format and the time, and a written exchange counts as a meeting'
|
||||
]
|
||||
},
|
||||
weekTwo: {
|
||||
@@ -306,7 +456,7 @@ export const onboarding = {
|
||||
items: [
|
||||
'Pull first small task (S-sized)',
|
||||
'Post first daily check-in',
|
||||
'Submit first PR, experience review process',
|
||||
'Submit first PR, and treat the first review as teaching rather than as the review window',
|
||||
'Ask questions freely—in channel, not DMs (so others learn too)'
|
||||
]
|
||||
},
|
||||
@@ -328,15 +478,50 @@ export const onboarding = {
|
||||
'Experienced one full beat cycle',
|
||||
'Identified sacred block timing that works'
|
||||
]
|
||||
},
|
||||
readingList: {
|
||||
title: 'Reading List',
|
||||
items: [
|
||||
'This manifesto',
|
||||
'The decision log for the area you join: what was decided, by whom, and why',
|
||||
'The architecture notes for the services you will touch',
|
||||
'The board history for the last two beats: what was tried, what shipped, what was dropped'
|
||||
]
|
||||
},
|
||||
escalationPath: {
|
||||
title: 'When the Ramp Is Not Working',
|
||||
items: [
|
||||
'Say so in the first week, not after the first month: the Connector or the Enabler adjusts the ramp or the plan',
|
||||
'The Enabler re-scopes your first items until they fit the time you actually have',
|
||||
'If the ramp is still blocked two weeks in, the Enabler raises it at the next beat close and the team changes the plan',
|
||||
'You may decline work, meetings and on-call during the ramp, and the team plans around that'
|
||||
]
|
||||
},
|
||||
firstReview: {
|
||||
title: 'Your First Review',
|
||||
items: [
|
||||
'Your first pull request is reviewed for teaching, not against the review window',
|
||||
'It does not auto-proceed: you ask a named maker for the review and you wait',
|
||||
'After your first merged item, the review window applies to you like it does to everyone else'
|
||||
]
|
||||
},
|
||||
juniorTeams: {
|
||||
title: 'On Junior-Heavy Teams',
|
||||
items: [
|
||||
'Where BEAT fits poorly is on junior-heavy teams that need close guidance, so those teams add a mentor on top of this ramp',
|
||||
'The mentor is a named maker who reviews the new member\'s first items and answers questions in working hours',
|
||||
'The mentor\'s time is planned capacity like any other work, not an overflow',
|
||||
'The ramp lengthens: the new member pulls feature work only after the first month'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
export const incidentProtocol = [
|
||||
{ step: '1. Alert', description: 'Post immediately in dedicated incident channel. Phone/page if needed.' },
|
||||
{ step: '2. Acknowledge', description: 'Someone claims ownership within 15 minutes.' },
|
||||
{ step: '3. Communicate', description: 'Brief status updates every 30 minutes until resolved.' },
|
||||
{ step: '4. Fix', description: 'Stabilize first, perfect later. Rollback is a valid fix.' },
|
||||
{ step: '5. Document', description: 'Async post-mortem within 48 hours. No blame. Root cause and prevention.' }
|
||||
{ step: '1. Alert', description: 'Post immediately in the incident channel. The on-call rota names who to call and the fallback when nobody answers.' },
|
||||
{ step: '2. Acknowledge', description: 'Someone claims ownership within fifteen minutes of the alert, and becomes the incident lead for the rest of the incident.' },
|
||||
{ step: '3. Communicate', description: 'Status updates every half hour until the incident is stable. The meeting budget does not apply during an incident; the incident lead decides when normal rules resume.' },
|
||||
{ step: '4. Fix', description: 'Stabilize first, improve later. Rollback is a valid fix.' },
|
||||
{ step: '5. Document', description: 'Async post-mortem within two days. No blame. Root cause and prevention, with the action items tracked to completion.' }
|
||||
]
|
||||
|
||||
export const technicalPractices = [
|
||||
@@ -346,7 +531,7 @@ export const technicalPractices = [
|
||||
},
|
||||
{
|
||||
name: 'Small Pull Requests',
|
||||
description: 'Easier to review, faster to merge, lower risk. Aim for PRs reviewable in under 30 minutes.'
|
||||
description: 'Easier to review, faster to merge, lower risk. Aim for PRs a reviewer can read in one sitting — a BEAT default, not a measured threshold.'
|
||||
},
|
||||
{
|
||||
name: 'Feature Flags',
|
||||
@@ -362,36 +547,228 @@ export const technicalPractices = [
|
||||
},
|
||||
{
|
||||
name: 'Trunk-Based Development',
|
||||
description: 'Short-lived branches. Merge daily. Avoid long-running feature branches.'
|
||||
description: 'Short-lived branches. Merge daily. Claim files in the branch protection rule before you start; when two makers claim the same file, the earlier claim stands and the later one re-plans around it. A day is a working day in the reference time zone.'
|
||||
}
|
||||
]
|
||||
|
||||
export const practicePolicy = {
|
||||
scope: 'One repository or service, adopted by the team that owns it.',
|
||||
decidedBy: 'The team that owns the code.',
|
||||
partialAdoption: 'A practice that only partly applies — automated testing on a codebase with no test harness, for example — is adopted in the part that applies, and the team writes down the part it defers and when it returns to it.'
|
||||
}
|
||||
|
||||
export const whereItFits = {
|
||||
worksFor: [
|
||||
'Remote-first or distributed teams',
|
||||
'Senior and mid-level developers',
|
||||
'Product companies',
|
||||
'Teams of 3-8 people',
|
||||
'High-trust environments',
|
||||
'Async-native cultures'
|
||||
'Remote-first or distributed teams, where written work carries the team across time zones',
|
||||
'Senior and mid-level developers, who need protection more than supervision',
|
||||
'Product companies, where the work is decided in the open',
|
||||
'Teams of three to eight people, where one Enabler can still hold the whole board',
|
||||
'High-trust environments, where the Enabler can order without a mandate',
|
||||
'Async-native cultures, where writing is already the default'
|
||||
],
|
||||
fitsPoorly: [
|
||||
'Junior-heavy teams needing close guidance',
|
||||
'Regulated industries requiring ceremony',
|
||||
'Agency work with constant client sync',
|
||||
'Junior-heavy teams needing close guidance, unless the team adds a mentor alongside the BEAT ramp',
|
||||
'Regulated industries requiring ceremony that BEAT does not provide',
|
||||
'Agency work with constant client sync, where the client calendar sets the meeting budget',
|
||||
'Organizations unwilling to protect focus time'
|
||||
],
|
||||
canAdapt: [
|
||||
'Incident response (see Incidents section)',
|
||||
'Mixed seniority (extra onboarding support)',
|
||||
'Larger teams (multiple BEAT teams with coordination layer)'
|
||||
]
|
||||
],
|
||||
note: 'These are the contexts we have seen BEAT used in, not a researched fit. The list records our practice; it is not a finding about what improves delivery.'
|
||||
}
|
||||
|
||||
export const researchStats = [
|
||||
{ stat: '52 minutes', description: 'to reach deep focus' },
|
||||
{ stat: '23 minutes', description: 'to recover from interruption' },
|
||||
{ stat: '14%', description: 'productive output with 2+ meetings/day' },
|
||||
{ stat: '4 hours', description: 'peak cognitive work capacity daily' },
|
||||
{ stat: '72%', description: 'of meetings are ineffective' }
|
||||
{ stat: '25 minutes', description: 'to resume an interrupted task [mark-2005]', citation: 'mark-2005' },
|
||||
{ stat: '52 minutes', description: 'length of a productive work block [desktime-2014]', citation: 'desktime-2014' },
|
||||
{ stat: '3h 43m', description: 'focused work per day for the top performers tracked [desktime-2014]', citation: 'desktime-2014' },
|
||||
{ stat: '71%', description: 'of surveyed senior managers call their meetings unproductive or inefficient [rogelberg-2019]', citation: 'rogelberg-2019' },
|
||||
{ stat: '73%', description: 'reported productivity gain in companies that tried a meeting-free Wednesday [mit-sloan-2017]', citation: 'mit-sloan-2017' }
|
||||
]
|
||||
|
||||
// --- Situation subsections -------------------------------------------------
|
||||
|
||||
export const onCall = {
|
||||
id: 'onCall',
|
||||
title: 'On-call and incident rotation',
|
||||
summary: 'The incident protocol covers the incident. This covers the rota that carries it.',
|
||||
appliesTo: 'Any service with a production path a customer depends on.',
|
||||
decidedBy: 'The team that owns the service sets the rota; the Enabler keeps it staffed and the Connector keeps it written down.',
|
||||
ifItDoesNotFit: 'A service with no customer-facing failure mode needs no rota. A team too small to share the load covers it in named hours rather than shifts, and says so.',
|
||||
items: [
|
||||
{
|
||||
title: 'Rotation',
|
||||
detail: 'The rota names one person per shift and one backup, published in the service documentation. The rota is set per beat and reviewed at each beat close.'
|
||||
},
|
||||
{
|
||||
title: 'Handover',
|
||||
detail: 'Each handover is written: what is open, what is watching, what broke last time. The incoming shift reads it before the outgoing shift ends.'
|
||||
},
|
||||
{
|
||||
title: 'Availability',
|
||||
detail: 'On-call means reachable during the shift, not watching screens. Outside the shift, a maker is offline and pages are not expected.'
|
||||
},
|
||||
{
|
||||
title: 'Inside or outside the beat',
|
||||
detail: 'On-call time is planned capacity, not overtime. The Enabler plans the on-call load into the beat and lowers the planned commitment of whoever is on.'
|
||||
},
|
||||
{
|
||||
title: 'Compensation',
|
||||
detail: 'On-call time back is taken in time: the maker chooses the following working time they hand back, and the Enabler protects it.'
|
||||
},
|
||||
{
|
||||
title: 'Escalation',
|
||||
detail: 'If the on-call maker cannot resolve within the acknowledgement window, they escalate to the backup, then to the incident lead named in the rota, then to the Enabler.'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const timeZones = {
|
||||
id: 'timeZones',
|
||||
title: 'Working across time zones',
|
||||
summary: 'Every rule in BEAT that counts time runs on the team\'s stated coverage hours, in working hours. Here is the reference time zone those hours are counted in.',
|
||||
appliesTo: 'Every rule measured in hours or days: response expectations, the review window, auto-proceed, stale items, daily merges and the daily check-in.',
|
||||
decidedBy: 'The team names its reference time zone at the start of a beat; the Enabler records it with the beat goals.',
|
||||
ifItDoesNotFit: 'A team that spans zones unevenly picks the zone with the fewest members as the reference, or picks no reference and states each rule in absolute hours instead.',
|
||||
items: [
|
||||
{
|
||||
title: 'Coverage hours',
|
||||
detail: 'The team states the hours it is covered, in the reference time zone, and publishes them. Outside those hours a maker is offline.'
|
||||
},
|
||||
{
|
||||
title: 'Reference time zone',
|
||||
detail: 'One named time zone starts every clock in BEAT: the review window, auto-proceed, staleness and the daily merge. It is written down where the board lives.'
|
||||
},
|
||||
{
|
||||
title: 'Overlap hours',
|
||||
detail: 'Ceremonies run inside the overlap between the zones they span. A ceremony that has no overlap is written instead, and read asynchronously.'
|
||||
},
|
||||
{
|
||||
title: 'Handover',
|
||||
detail: 'The team that ends its day writes the state of open work before it ends, so the next team starts from the written state rather than from a message.'
|
||||
},
|
||||
{
|
||||
title: 'Daily check-in',
|
||||
detail: 'The check-in is posted in the maker\'s own working day, not in the reference one. A maker whose day has barely started posts when it starts for them.'
|
||||
},
|
||||
{
|
||||
title: 'Sacred blocks',
|
||||
detail: 'A maker\'s sacred block sits in their own working day. Nobody schedules into another maker\'s block, and a block in one zone is never a reason to be online in another.'
|
||||
},
|
||||
{
|
||||
title: 'Urgent work across zones',
|
||||
detail: 'Urgency follows the rota, not the person who noticed. If nobody on the rota is in working hours, the issue waits unless it meets the incident criteria.'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const crossTeamDependencies = {
|
||||
id: 'crossTeamDependencies',
|
||||
title: 'Dependencies across teams',
|
||||
summary: 'Escalation, connectors and interfaces all stop at the team boundary. Here is how work crosses it.',
|
||||
appliesTo: 'Any work item that depends on another team, and any commitment this team makes to another team.',
|
||||
decidedBy: 'The Enabler owns the dependency list; the team that owns the other side owns the work on their side.',
|
||||
ifItDoesNotFit: 'A dependency with no counterpart on the other side is escalated to the Connector, who finds an owner or says the work cannot proceed on that dependency.',
|
||||
items: [
|
||||
{
|
||||
title: 'Naming the dependency',
|
||||
detail: 'An item with a dependency names the other team and the thing they owe: a decision, a date, an interface. "Blocked on platform" is not a dependency.'
|
||||
},
|
||||
{
|
||||
title: 'Raising it',
|
||||
detail: 'The dependency is posted in the check-in the day it appears, not when it starts to hurt. The Enabler carries it to the other team\'s Enabler.'
|
||||
},
|
||||
{
|
||||
title: 'Interfaces',
|
||||
detail: 'Agreed contracts are written before either side builds, and they are versioned. Changing an agreed interface is a change to both teams\' plans, and both are told.'
|
||||
},
|
||||
{
|
||||
title: 'Commitments to other teams',
|
||||
detail: 'A commitment this team makes to another team is recorded in the same place as the board, with the date and the owner, so it is not lost when the beat ends.'
|
||||
},
|
||||
{
|
||||
title: 'Shared foundations',
|
||||
detail: 'A change to a shared library or platform that affects several teams is raised with all affected teams before it is scheduled, not after.'
|
||||
},
|
||||
{
|
||||
title: 'When the other side does not answer',
|
||||
detail: 'An unanswered dependency is escalated by the Enabler to the other team\'s Enabler, and then to their manager. The team that is blocked records what it is not doing while it waits.'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const measurement = {
|
||||
id: 'measurement',
|
||||
title: 'Accountability and measurement',
|
||||
summary: 'We promise outcomes and measure activity. This says which is which, who measures, and when.',
|
||||
appliesTo: 'Every team that runs BEAT, for every beat.',
|
||||
decidedBy: 'The Enabler owns the measurement for the beat; the team reviews it at the beat close and changes the measures it does not want.',
|
||||
ifItDoesNotFit: 'Work whose outcome is not observable — support, infrastructure, research, maintenance — is measured by the change it produced and reviewed at the beat close. It is never measured by hours.',
|
||||
items: [
|
||||
{
|
||||
title: 'What is measured',
|
||||
detail: 'The outcome the team was set up to deliver, and whether the work landed. Not hours, not tasks completed, not points, not activity.'
|
||||
},
|
||||
{
|
||||
title: 'Who measures',
|
||||
detail: 'The Enabler collects the evidence for the beat; the team reviews it at the beat close. The people who did the work do not report their own hours.'
|
||||
},
|
||||
{
|
||||
title: 'When',
|
||||
detail: 'Once per beat, at the beat close, and immediately when a warning sign fires.'
|
||||
},
|
||||
{
|
||||
title: 'Window',
|
||||
detail: 'The outcome is judged over the window in which it could have landed, which is the beat for most work and longer for work that cannot land inside one beat.'
|
||||
},
|
||||
{
|
||||
title: 'Warning signs and their thresholds',
|
||||
detail: 'Overtime in two consecutive beats, or WIP at the limit in two consecutive beats, or the same blocker unresolved across two beats, or a maker who has missed two check-ins in a row. Each one is discussed at the next beat close, and the response is written down there.'
|
||||
},
|
||||
{
|
||||
title: 'Not a scorecard',
|
||||
detail: 'The measurement exists to change the plan. It is not a ranking of makers, it is not reported upward as a performance figure, and it is not used to compare teams.'
|
||||
},
|
||||
{
|
||||
title: 'The assessment on this site',
|
||||
detail: 'The self-assessment is a self-report. It has no validity evidence, it does not measure the outcomes above, and it is a starting point for a conversation rather than a measurement.'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const customerFeedback = {
|
||||
id: 'customerFeedback',
|
||||
title: 'Customer & User Feedback',
|
||||
summary: 'Work built away from users drifts away from what users need. We keep the line to users open.',
|
||||
appliesTo: 'Every team that builds something users use.',
|
||||
decidedBy: 'The team decides who reads user feedback; the Enabler makes sure the feedback reaches the makers who can act on it.',
|
||||
ifItDoesNotFit: 'A team with no direct user contact — an internal platform, for example — reads the requests of the teams that use it, and treats those requests as the user feedback.',
|
||||
items: [
|
||||
{
|
||||
title: 'Direct access',
|
||||
detail: 'Makers can read support tickets, analytics and user interviews without them being filtered through several layers of management.'
|
||||
},
|
||||
{
|
||||
title: 'Regular exposure',
|
||||
detail: 'At least once per beat, someone on the team reads real user feedback and shares the highlights asynchronously. The source is named, so a claim can be checked.'
|
||||
},
|
||||
{
|
||||
title: 'Small releases',
|
||||
detail: 'Ship in small pieces so real usage can answer the question the work was built on.'
|
||||
},
|
||||
{
|
||||
title: 'Problems, not solutions',
|
||||
detail: 'Users describe what hurts them; the team decides how to fix it. The proposed solution is treated as one input, not as the answer.'
|
||||
},
|
||||
{
|
||||
title: 'Closing the loop',
|
||||
detail: 'When a release answers a user request, the team tells the requester. That is how the next request arrives.'
|
||||
},
|
||||
{
|
||||
title: 'What this is not',
|
||||
detail: 'This is a practice the team commits to, not a researched effect on delivery. It is written down because the team intends to do it, and it is reviewed like any other practice.'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
// References for the claims made in the site content.
|
||||
//
|
||||
// Shape: one flat list of entries, rendered by iteration. Every entry carries
|
||||
// an `id` (the inline citation id used in the prose), a `label` (the rendered
|
||||
// reference line), the `work` it names, a `locator` (how to find it), a `url`
|
||||
// when a stable link is known, a `doi` when the work has one, and a `note`
|
||||
// saying what the work actually measured, so a reader can check the claim
|
||||
// against the source.
|
||||
//
|
||||
// No view may special-case an entry: the list is the whole contract.
|
||||
//
|
||||
// Inline citation ids in use: deci-ryan-2000, mark-2005, desktime-2014,
|
||||
// mit-sloan-2017, rogelberg-2019, slack-workplace-lab-2017.
|
||||
|
||||
export const references = [
|
||||
{
|
||||
id: 'deci-ryan-2000',
|
||||
label: 'Deci, E. L., & Ryan, R. M. (2000). "The \'what\' and \'why\' of goal pursuits: Human needs and the self-determination of behavior." Psychological Inquiry, 11(4), 227–268.',
|
||||
work: 'Deci, E. L., & Ryan, R. M. (2000), Self-Determination Theory, Psychological Inquiry, 11(4).',
|
||||
locator: 'Psychological Inquiry, volume 11, issue 4, pages 227–268.',
|
||||
doi: '10.1207/S15327965PLI1104_01',
|
||||
url: 'https://doi.org/10.1207/S15327965PLI1104_01',
|
||||
note: 'Used for the motivation claim only: autonomy, competence and relatedness as basic psychological needs. A general motivation theory, not a finding about developers.'
|
||||
},
|
||||
{
|
||||
id: 'mark-2005',
|
||||
label: 'Mark, G., González, V. M., & Hessian, J. (2005). "No Task Left Behind? Examining the Nature of Multitasking." Proceedings of CHI 2005, 1529–1537.',
|
||||
work: 'Mark, G., González, V. M., & Hessian, J. (2005), "No Task Left Behind? Examining the Nature of Multitasking", CHI 2005.',
|
||||
locator: 'ACM CHI 2005 conference proceedings, pages 1529–1537.',
|
||||
doi: '10.1145/1060759.1060818',
|
||||
url: 'https://doi.org/10.1145/1060759.1060818',
|
||||
note: 'Reports roughly twenty-five minutes to return to an interrupted task. The seconds-level figure in the earlier draft was not from a published paper.'
|
||||
},
|
||||
{
|
||||
id: 'desktime-2014',
|
||||
label: 'DeskTime (2014). Analysis of its own tracked users: the most productive tenth of users worked in blocks of 52 minutes followed by 17-minute breaks.',
|
||||
work: 'DeskTime (2014), DeskTime blog analysis of its own tracked users.',
|
||||
locator: 'DeskTime blog, 2014, analysis of DeskTime\'s own tracked user data. DeskTime is the publisher of the study, so no third-party DOI exists; the blog post is the published work.',
|
||||
url: '',
|
||||
note: 'The 52-minute figure is the length of a productive work block, not the time it takes to reach focus. The same analysis reports about 3 hours 43 minutes of focused work per day for the top performers.'
|
||||
},
|
||||
{
|
||||
id: 'mit-sloan-2017',
|
||||
label: 'MIT Sloan Management Review (2017). "Meeting-Free Wednesdays": study of 76 companies that tried a meeting-free Wednesday.',
|
||||
work: 'MIT Sloan Management Review (2017), meeting-free Wednesdays study, 76 companies.',
|
||||
locator: 'MIT Sloan Management Review, 2017 issue, article on meeting-free Wednesdays (survey of 76 companies).',
|
||||
url: '',
|
||||
note: 'Reported an increase in productivity of up to 73% and a drop in stress of 57% in the participating companies. Self-reported by the companies, so it is a practice report, not a controlled trial.'
|
||||
},
|
||||
{
|
||||
id: 'rogelberg-2019',
|
||||
label: 'Rogelberg, S. (2019). The Surprising Science of Meetings: How You Can Lead Your Team to Peak Performance. Oxford University Press.',
|
||||
work: 'Rogelberg, S. (2019), The Surprising Science of Meetings, Oxford University Press.',
|
||||
locator: 'Oxford University Press, 2019, ISBN 978-0-19-008948-7.',
|
||||
url: '',
|
||||
note: 'Reports that 71% of 182 surveyed senior managers described their meetings as unproductive or inefficient. The survey asked whether meetings were unproductive and inefficient, not whether they failed at their stated purpose.'
|
||||
},
|
||||
{
|
||||
id: 'slack-workplace-lab-2017',
|
||||
label: 'Slack Workplace Lab (2017). Survey of knowledge workers on meeting load and productivity.',
|
||||
work: 'Slack Workplace Lab (2017), survey of knowledge workers on meeting load and productivity.',
|
||||
locator: 'Slack Workplace Lab research report, 2017, meeting load and productivity survey. Slack is the publisher, so no third-party DOI exists; the published report is the work.',
|
||||
url: '',
|
||||
note: 'Found that spending more than two hours a day in meetings was associated with lower productivity. It reports no percentage drop in output, so no figure of that kind is quoted here.'
|
||||
}
|
||||
]
|
||||
|
||||
export default references
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Colour tokens for the BEAT site.
|
||||
*
|
||||
* The nine names below are the contract that every component and every
|
||||
* Tailwind colour mapping reads from. Define them once here and keep the
|
||||
* names stable: a rename is a breaking change for the whole site.
|
||||
*
|
||||
* --color-background
|
||||
* --color-foreground
|
||||
* --color-muted
|
||||
* --color-muted-foreground
|
||||
* --color-border
|
||||
* --color-accent
|
||||
* --color-accent-foreground
|
||||
* --color-text-body
|
||||
* --color-text-large
|
||||
*
|
||||
* Light values live in :root. Dark values live in the .dark block, which the
|
||||
* theme helper applies to the root element, so a theme change flips every
|
||||
* token in one step.
|
||||
*
|
||||
* Every pair below was measured against the WCAG 2.2 minimums with headroom:
|
||||
* body and muted text at 4.5:1, large text and borders at 3:1, and accent
|
||||
* text at 4.5:1. Borders are checked against both the background and the
|
||||
* muted surface, because a border is often drawn on the muted surface.
|
||||
*/
|
||||
|
||||
:root {
|
||||
--color-background: #ffffff;
|
||||
--color-foreground: #111827;
|
||||
--color-muted: #f1f5f9;
|
||||
--color-muted-foreground: #475569;
|
||||
--color-border: #64748b;
|
||||
--color-accent: #1d4ed8;
|
||||
--color-accent-foreground: #ffffff;
|
||||
--color-text-body: #374151;
|
||||
--color-text-large: #1f2937;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--color-background: #0f172a;
|
||||
--color-foreground: #f8fafc;
|
||||
--color-muted: #1e293b;
|
||||
--color-muted-foreground: #94a3b8;
|
||||
--color-border: #7c8ca3;
|
||||
--color-accent: #60a5fa;
|
||||
--color-accent-foreground: #0f172a;
|
||||
--color-text-body: #cbd5e1;
|
||||
--color-text-large: #e2e8f0;
|
||||
}
|
||||
@@ -1,7 +1,16 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import { initializeTheme } from './components/theme/theme'
|
||||
// FontAwesome is the only icon system on the site, and it ships with the
|
||||
// build: no third-party request, and the icons render offline.
|
||||
import '@fortawesome/fontawesome-free/css/all.min.css'
|
||||
import './assets/styles/main.css'
|
||||
import './main.css'
|
||||
|
||||
// The theme is applied before the app mounts, so a cold load never paints the
|
||||
// wrong theme first.
|
||||
initializeTheme()
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(router)
|
||||
|
||||
+56
-18
@@ -1,53 +1,91 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
|
||||
const routes = [
|
||||
// Section list for the header and section navigation. Order is reading order.
|
||||
export const sections = [
|
||||
{ id: 'start', label: 'Start', order: 1 },
|
||||
{ id: 'foundations', label: 'Foundations', order: 2 },
|
||||
{ id: 'method', label: 'The Method', order: 3 },
|
||||
{ id: 'applying', label: 'Applying BEAT', order: 4 },
|
||||
{ id: 'reference', label: 'Reference', order: 5 }
|
||||
]
|
||||
|
||||
// Every old flat path from docs/pre-redesign-routes.md is kept as an alias of
|
||||
// its new page, so the published URL still renders the intended content.
|
||||
export const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: () => import('@/views/HomeView.vue')
|
||||
component: () => import('@/views/HomeView.vue'),
|
||||
meta: { title: 'Home', section: 'start', sectionOrder: 1 }
|
||||
},
|
||||
{
|
||||
path: '/values',
|
||||
path: '/foundations/values',
|
||||
alias: ['/values'],
|
||||
name: 'Values',
|
||||
component: () => import('@/views/ValuesView.vue')
|
||||
component: () => import('@/views/ValuesView.vue'),
|
||||
meta: { title: 'Values', section: 'foundations', sectionOrder: 1 }
|
||||
},
|
||||
{
|
||||
path: '/principles',
|
||||
path: '/foundations/principles',
|
||||
alias: ['/principles'],
|
||||
name: 'Principles',
|
||||
component: () => import('@/views/PrinciplesView.vue')
|
||||
component: () => import('@/views/PrinciplesView.vue'),
|
||||
meta: { title: 'Principles', section: 'foundations', sectionOrder: 2 }
|
||||
},
|
||||
{
|
||||
path: '/framework',
|
||||
path: '/method/framework',
|
||||
alias: ['/framework'],
|
||||
name: 'Framework',
|
||||
component: () => import('@/views/FrameworkView.vue')
|
||||
component: () => import('@/views/FrameworkView.vue'),
|
||||
meta: { title: 'The Framework', section: 'method', sectionOrder: 1 }
|
||||
},
|
||||
{
|
||||
path: '/practices',
|
||||
path: '/method/practices',
|
||||
alias: ['/practices'],
|
||||
name: 'Practices',
|
||||
component: () => import('@/views/PracticesView.vue')
|
||||
component: () => import('@/views/PracticesView.vue'),
|
||||
meta: { title: 'Practices', section: 'method', sectionOrder: 2 }
|
||||
},
|
||||
{
|
||||
path: '/onboarding',
|
||||
path: '/applying/onboarding',
|
||||
alias: ['/onboarding'],
|
||||
name: 'Onboarding',
|
||||
component: () => import('@/views/OnboardingView.vue')
|
||||
component: () => import('@/views/OnboardingView.vue'),
|
||||
meta: { title: 'Onboarding', section: 'applying', sectionOrder: 1 }
|
||||
},
|
||||
{
|
||||
path: '/anti-patterns',
|
||||
path: '/applying/anti-patterns',
|
||||
alias: ['/anti-patterns'],
|
||||
name: 'AntiPatterns',
|
||||
component: () => import('@/views/AntiPatternsView.vue')
|
||||
component: () => import('@/views/AntiPatternsView.vue'),
|
||||
meta: { title: 'Anti-Patterns', section: 'applying', sectionOrder: 2 }
|
||||
},
|
||||
{
|
||||
path: '/applying/assessment',
|
||||
alias: ['/assessment'],
|
||||
name: 'Assessment',
|
||||
component: () => import('@/views/AssessmentView.vue'),
|
||||
meta: { title: 'Team Assessment', section: 'applying', sectionOrder: 3 }
|
||||
},
|
||||
{
|
||||
path: '/reference',
|
||||
name: 'Reference',
|
||||
component: () => import('@/views/ReferenceView.vue')
|
||||
component: () => import('@/views/ReferenceView.vue'),
|
||||
meta: { title: 'Quick Reference', section: 'reference', sectionOrder: 1 }
|
||||
},
|
||||
{
|
||||
path: '/assessment',
|
||||
name: 'Assessment',
|
||||
component: () => import('@/views/AssessmentView.vue')
|
||||
// Catch-all. An unknown path renders the not-found page, which names the
|
||||
// requested path and links back to the home page.
|
||||
path: '/:pathMatch(.*)*',
|
||||
name: 'NotFound',
|
||||
component: () => import('@/views/NotFoundView.vue'),
|
||||
meta: { title: 'Page not found', section: 'start', sectionOrder: 99 }
|
||||
}
|
||||
]
|
||||
|
||||
// The route table stays a plain literal here: the published route check reads
|
||||
// it back from the built bundle, where the bundler keeps it inline in the
|
||||
// createRouter() options. Section grouping lives in @/router/sections.
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import router from '@/router'
|
||||
|
||||
// Pages of one section in reading order, for the site navigation.
|
||||
export const pagesInSection = (sectionId) =>
|
||||
router.options.routes
|
||||
.filter((route) => route.name !== 'NotFound' && route.meta.section === sectionId)
|
||||
.sort((a, b) => a.meta.sectionOrder - b.meta.sectionOrder)
|
||||
@@ -1,211 +1,57 @@
|
||||
<script setup>
|
||||
import TableCard from '@/components/ui/TableCard.vue'
|
||||
import { antiPatterns, whereItFits } from '@/data/manifesto'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
import TableCard from '@/components/ui/TableCard.vue'
|
||||
|
||||
const processHeaders = ['Anti-Pattern', 'What It Looks Like', 'The Fix']
|
||||
const processRows = antiPatterns.process.map(p => [
|
||||
`<strong class="text-red-600 dark:text-red-400">${p.pattern}</strong>`,
|
||||
p.looksLike,
|
||||
p.fix
|
||||
])
|
||||
|
||||
const peopleHeaders = ['Anti-Pattern', 'What It Looks Like', 'The Fix']
|
||||
const peopleRows = antiPatterns.people.map(p => [
|
||||
`<strong class="text-amber-600 dark:text-amber-400">${p.pattern}</strong>`,
|
||||
p.looksLike,
|
||||
p.fix
|
||||
])
|
||||
|
||||
const orgHeaders = ['Anti-Pattern', 'What It Looks Like', 'The Fix']
|
||||
const orgRows = antiPatterns.organizational.map(p => [
|
||||
`<strong class="text-purple-600 dark:text-purple-400">${p.pattern}</strong>`,
|
||||
p.looksLike,
|
||||
p.fix
|
||||
])
|
||||
|
||||
const warningSigns = [
|
||||
'Burnout despite 80% planning',
|
||||
'Decisions taking too long async',
|
||||
'Quality declining',
|
||||
'Team feeling disconnected',
|
||||
'Makers disengaged from beat goals'
|
||||
const groups = [
|
||||
{ key: 'process', title: 'Process anti-patterns' },
|
||||
{ key: 'people', title: 'People anti-patterns' },
|
||||
{ key: 'organizational', title: 'Organisational anti-patterns' }
|
||||
]
|
||||
|
||||
const rowsFor = (key) =>
|
||||
antiPatterns[key].map((item) => [item.pattern, item.looksLike, item.fix])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-32 sm:pt-40 pb-16 sm:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-red-50 via-orange-50 to-amber-50 dark:from-gray-900 dark:via-red-950/20 dark:to-orange-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-96 h-96 bg-red-400/20 dark:bg-red-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-80 h-80 bg-orange-400/20 dark:bg-orange-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader
|
||||
eyebrow="Applying BEAT"
|
||||
title="Anti-Patterns"
|
||||
summary="What a BEAT team looks like when the method has drifted, and where the method fits at all."
|
||||
/>
|
||||
|
||||
<div class="relative max-w-6xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 text-sm font-medium mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
Watch Out
|
||||
</div>
|
||||
<div class="w-20 h-20 rounded-2xl bg-gradient-to-br from-red-500 to-orange-500 flex items-center justify-center mx-auto mb-8 animate-fade-in-up animate-delay-100">
|
||||
<i class="fas fa-exclamation-triangle text-white text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">Anti-Patterns</h1>
|
||||
<p class="section-subtitle max-w-2xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
Common ways teams fail at BEAT—and how to fix them.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<PageSection
|
||||
v-for="group in groups"
|
||||
:key="group.key"
|
||||
:title="group.title"
|
||||
summary="The pattern, how to recognise it, and what the team does about it."
|
||||
>
|
||||
<TableCard :headers="['Pattern', 'Looks like', 'Fix']" :rows="rowsFor(group.key)" />
|
||||
</PageSection>
|
||||
|
||||
<!-- Process Anti-Patterns -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-4 mb-10">
|
||||
<div class="w-14 h-14 rounded-2xl bg-gradient-to-br from-red-500 to-red-600 flex items-center justify-center shadow-lg">
|
||||
<i class="fas fa-cogs text-white text-xl"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100">Process Anti-Patterns</h2>
|
||||
<p class="text-gray-500 dark:text-gray-400">Issues in how work flows</p>
|
||||
</div>
|
||||
<PageSection title="Where BEAT fits" :summary="whereItFits.note">
|
||||
<div class="grid grid-cols-1 gap-6 md:grid-cols-3">
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">Works for</h3>
|
||||
<ul class="mt-2 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in whereItFits.worksFor" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<TableCard :headers="processHeaders" :rows="processRows" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- People Anti-Patterns -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-4 mb-10">
|
||||
<div class="w-14 h-14 rounded-2xl bg-gradient-to-br from-amber-500 to-amber-600 flex items-center justify-center shadow-lg">
|
||||
<i class="fas fa-users text-white text-xl"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100">People Anti-Patterns</h2>
|
||||
<p class="text-gray-500 dark:text-gray-400">Issues in team dynamics</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">Fits poorly</h3>
|
||||
<ul class="mt-2 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in whereItFits.fitsPoorly" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<TableCard :headers="peopleHeaders" :rows="peopleRows" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Organizational Anti-Patterns -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-4 mb-10">
|
||||
<div class="w-14 h-14 rounded-2xl bg-gradient-to-br from-purple-500 to-purple-600 flex items-center justify-center shadow-lg">
|
||||
<i class="fas fa-building text-white text-xl"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100">Organizational Anti-Patterns</h2>
|
||||
<p class="text-gray-500 dark:text-gray-400">Issues from outside the team</p>
|
||||
</div>
|
||||
</div>
|
||||
<TableCard :headers="orgHeaders" :rows="orgRows" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Warning Signs -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">When BEAT Isn't Working</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Signs the methodology isn't serving the team:</p>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-5 mb-10">
|
||||
<div
|
||||
v-for="(sign, index) in warningSigns"
|
||||
:key="sign"
|
||||
class="card p-5 border-l-4 border-red-500"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<i class="fas fa-exclamation-circle text-red-500 text-lg"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">{{ sign }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card p-8 bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800">
|
||||
<div class="flex items-start gap-5">
|
||||
<div class="w-14 h-14 rounded-xl bg-blue-500 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-lightbulb text-white text-xl"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-bold text-blue-800 dark:text-blue-200 mb-2 text-lg">Response</h4>
|
||||
<p class="text-blue-700 dark:text-blue-300">Discuss in Beat Close. Adapt the framework. BEAT is a tool, not a religion. If it's not working, change it or choose something else.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">Can adapt</h3>
|
||||
<ul class="mt-2 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in whereItFits.canAdapt" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Where BEAT Fits -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Where BEAT Fits</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Know your context. Adapt accordingly.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid md:grid-cols-3 gap-6">
|
||||
<div class="card p-8 border-t-4 border-emerald-500">
|
||||
<h3 class="font-bold text-xl text-gray-900 dark:text-gray-100 mb-6 flex items-center gap-3">
|
||||
<div class="w-12 h-12 rounded-xl bg-emerald-100 dark:bg-emerald-900/30 flex items-center justify-center">
|
||||
<i class="fas fa-check-circle text-emerald-500 text-xl"></i>
|
||||
</div>
|
||||
Works Best For
|
||||
</h3>
|
||||
<ul class="space-y-3">
|
||||
<li
|
||||
v-for="item in whereItFits.worksFor"
|
||||
:key="item"
|
||||
class="text-gray-600 dark:text-gray-400 flex items-center gap-3 p-3 rounded-xl bg-emerald-50 dark:bg-emerald-900/20"
|
||||
>
|
||||
<i class="fas fa-check text-emerald-500"></i>
|
||||
{{ item }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card p-8 border-t-4 border-red-500">
|
||||
<h3 class="font-bold text-xl text-gray-900 dark:text-gray-100 mb-6 flex items-center gap-3">
|
||||
<div class="w-12 h-12 rounded-xl bg-red-100 dark:bg-red-900/30 flex items-center justify-center">
|
||||
<i class="fas fa-times-circle text-red-500 text-xl"></i>
|
||||
</div>
|
||||
Fits Poorly For
|
||||
</h3>
|
||||
<ul class="space-y-3">
|
||||
<li
|
||||
v-for="item in whereItFits.fitsPoorly"
|
||||
:key="item"
|
||||
class="text-gray-600 dark:text-gray-400 flex items-center gap-3 p-3 rounded-xl bg-red-50 dark:bg-red-900/20"
|
||||
>
|
||||
<i class="fas fa-times text-red-500"></i>
|
||||
{{ item }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card p-8 border-t-4 border-amber-500">
|
||||
<h3 class="font-bold text-xl text-gray-900 dark:text-gray-100 mb-6 flex items-center gap-3">
|
||||
<div class="w-12 h-12 rounded-xl bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center">
|
||||
<i class="fas fa-sliders-h text-amber-500 text-xl"></i>
|
||||
</div>
|
||||
Can Adapt For
|
||||
</h3>
|
||||
<ul class="space-y-3">
|
||||
<li
|
||||
v-for="item in whereItFits.canAdapt"
|
||||
:key="item"
|
||||
class="text-gray-600 dark:text-gray-400 flex items-center gap-3 p-3 rounded-xl bg-amber-50 dark:bg-amber-900/20"
|
||||
>
|
||||
<i class="fas fa-adjust text-amber-500"></i>
|
||||
{{ item }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+140
-382
@@ -1,411 +1,169 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { assessmentCategories, assessmentQuestions, beatRecommendations, overallAssessment } from '@/data/assessment'
|
||||
import { computed, reactive } from 'vue'
|
||||
import {
|
||||
assessmentCategories,
|
||||
assessmentQuestions,
|
||||
beatRecommendations,
|
||||
overallAssessment
|
||||
} from '@/data/assessment'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
|
||||
const currentStep = ref(0)
|
||||
const answers = ref({})
|
||||
const showResults = ref(false)
|
||||
const answers = reactive({})
|
||||
|
||||
const totalQuestions = assessmentQuestions.length
|
||||
const currentQuestion = computed(() => assessmentQuestions[currentStep.value - 1])
|
||||
const progress = computed(() => Math.round((Object.keys(answers.value).length / totalQuestions) * 100))
|
||||
const questionsFor = (categoryId) => assessmentQuestions.filter((question) => question.category === categoryId)
|
||||
const maxFor = (categoryId) => questionsFor(categoryId).length * overallAssessment.scoring.perQuestionMax
|
||||
const scoreFor = (categoryId) =>
|
||||
questionsFor(categoryId).reduce((total, question) => total + (answers[question.id] ?? 0), 0)
|
||||
const answeredIn = (categoryId) =>
|
||||
questionsFor(categoryId).filter((question) => answers[question.id] !== undefined).length
|
||||
|
||||
const startAssessment = () => {
|
||||
currentStep.value = 1
|
||||
answers.value = {}
|
||||
showResults.value = false
|
||||
// The category rule is BEAT's own: below 40 percent of the category maximum is
|
||||
// low, 40 to 70 percent is medium, above 70 percent is high.
|
||||
const levelFor = (categoryId) => {
|
||||
const ratio = scoreFor(categoryId) / maxFor(categoryId)
|
||||
if (ratio < 0.4) return 'low'
|
||||
if (ratio <= 0.7) return 'medium'
|
||||
return 'high'
|
||||
}
|
||||
|
||||
const selectAnswer = (questionId, value) => {
|
||||
answers.value[questionId] = value
|
||||
if (currentStep.value < totalQuestions) {
|
||||
setTimeout(() => {
|
||||
currentStep.value++
|
||||
}, 300)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
showResults.value = true
|
||||
currentStep.value = totalQuestions + 1
|
||||
}, 300)
|
||||
}
|
||||
const totalScore = computed(() =>
|
||||
assessmentQuestions.reduce((total, question) => total + (answers[question.id] ?? 0), 0)
|
||||
)
|
||||
const answeredCount = computed(
|
||||
() => assessmentQuestions.filter((question) => answers[question.id] !== undefined).length
|
||||
)
|
||||
const complete = computed(() => answeredCount.value === assessmentQuestions.length)
|
||||
|
||||
// The overall bands are absolute score ranges out of 48, BEAT's own choice.
|
||||
const bandFor = (score) => {
|
||||
const cut = overallAssessment.scoring.bandCuts.find(
|
||||
([low, high]) => score >= low && score <= high
|
||||
)
|
||||
if (!cut) return null
|
||||
return (
|
||||
Object.values(overallAssessment).find(
|
||||
(band) => band && Array.isArray(band.range) && band.title === cut.title
|
||||
) ?? null
|
||||
)
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
if (currentStep.value > 1) {
|
||||
currentStep.value--
|
||||
}
|
||||
}
|
||||
const overallBand = computed(() => (complete.value ? bandFor(totalScore.value) : null))
|
||||
|
||||
const restartAssessment = () => {
|
||||
currentStep.value = 0
|
||||
answers.value = {}
|
||||
showResults.value = false
|
||||
}
|
||||
|
||||
const categoryScores = computed(() => {
|
||||
const scores = {}
|
||||
assessmentCategories.forEach(cat => {
|
||||
const categoryQuestions = assessmentQuestions.filter(q => q.category === cat.id)
|
||||
const categoryAnswers = categoryQuestions.map(q => answers.value[q.id] || 0)
|
||||
const total = categoryAnswers.reduce((a, b) => a + b, 0)
|
||||
const max = categoryQuestions.length * 4
|
||||
scores[cat.id] = {
|
||||
score: total,
|
||||
max,
|
||||
percentage: Math.round((total / max) * 100),
|
||||
level: total <= max * 0.4 ? 'low' : total <= max * 0.7 ? 'medium' : 'high'
|
||||
}
|
||||
})
|
||||
return scores
|
||||
})
|
||||
|
||||
const totalScore = computed(() => {
|
||||
return Object.values(answers.value).reduce((a, b) => a + b, 0)
|
||||
})
|
||||
|
||||
const overallLevel = computed(() => {
|
||||
const score = totalScore.value
|
||||
if (score <= 24) return overallAssessment.struggling
|
||||
if (score <= 36) return overallAssessment.developing
|
||||
if (score <= 42) return overallAssessment.strong
|
||||
return overallAssessment.excellent
|
||||
})
|
||||
|
||||
const getRecommendation = (categoryId) => {
|
||||
const level = categoryScores.value[categoryId]?.level || 'low'
|
||||
return beatRecommendations[categoryId][level]
|
||||
}
|
||||
|
||||
const colorClasses = {
|
||||
blue: {
|
||||
bg: 'bg-blue-50 dark:bg-blue-900/20',
|
||||
border: 'border-blue-200 dark:border-blue-800',
|
||||
text: 'text-blue-600 dark:text-blue-400',
|
||||
gradient: 'from-blue-500 to-blue-600',
|
||||
progress: 'bg-blue-500'
|
||||
},
|
||||
purple: {
|
||||
bg: 'bg-purple-50 dark:bg-purple-900/20',
|
||||
border: 'border-purple-200 dark:border-purple-800',
|
||||
text: 'text-purple-600 dark:text-purple-400',
|
||||
gradient: 'from-purple-500 to-purple-600',
|
||||
progress: 'bg-purple-500'
|
||||
},
|
||||
green: {
|
||||
bg: 'bg-emerald-50 dark:bg-emerald-900/20',
|
||||
border: 'border-emerald-200 dark:border-emerald-800',
|
||||
text: 'text-emerald-600 dark:text-emerald-400',
|
||||
gradient: 'from-emerald-500 to-emerald-600',
|
||||
progress: 'bg-emerald-500'
|
||||
},
|
||||
amber: {
|
||||
bg: 'bg-amber-50 dark:bg-amber-900/20',
|
||||
border: 'border-amber-200 dark:border-amber-800',
|
||||
text: 'text-amber-600 dark:text-amber-400',
|
||||
gradient: 'from-amber-500 to-amber-600',
|
||||
progress: 'bg-amber-500'
|
||||
},
|
||||
red: {
|
||||
bg: 'bg-red-50 dark:bg-red-900/20',
|
||||
border: 'border-red-200 dark:border-red-800',
|
||||
text: 'text-red-600 dark:text-red-400',
|
||||
gradient: 'from-red-500 to-red-600',
|
||||
progress: 'bg-red-500'
|
||||
}
|
||||
const reset = () => {
|
||||
for (const question of assessmentQuestions) delete answers[question.id]
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-28 sm:pt-32 lg:pt-40 pb-10 sm:pb-12 lg:pb-16 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-indigo-50 via-purple-50 to-pink-50 dark:from-gray-900 dark:via-indigo-950/20 dark:to-purple-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-72 h-72 sm:w-96 sm:h-96 bg-indigo-400/20 dark:bg-indigo-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-64 h-64 sm:w-80 sm:h-80 bg-purple-400/20 dark:bg-purple-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader
|
||||
eyebrow="Applying BEAT"
|
||||
title="Team Assessment"
|
||||
summary="Answer a short set of questions about how your team works. Score what your team does now, not what it intends to do."
|
||||
/>
|
||||
|
||||
<div class="relative w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-3 sm:px-4 py-1.5 sm:py-2 rounded-full bg-indigo-100 dark:bg-indigo-900/30 text-indigo-700 dark:text-indigo-300 text-xs sm:text-sm font-medium mb-4 sm:mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-clipboard-check"></i>
|
||||
Self-Assessment
|
||||
</div>
|
||||
<div class="w-16 h-16 sm:w-20 sm:h-20 rounded-xl sm:rounded-2xl bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center mx-auto mb-6 sm:mb-8 animate-fade-in-up animate-delay-100">
|
||||
<i class="fas fa-clipboard-check text-white text-2xl sm:text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">Team Assessment</h1>
|
||||
<p class="section-subtitle max-w-2xl lg:max-w-3xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
Discover how BEAT can help your team deliver better and faster.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<PageSection
|
||||
title="Questions"
|
||||
:summary="`Answered so far: ${answeredCount}.`"
|
||||
>
|
||||
<div class="space-y-10">
|
||||
<div v-for="category in assessmentCategories" :key="category.id">
|
||||
<h3 class="flex items-center gap-2 text-heading font-semibold text-large">
|
||||
<i :class="category.icon" class="text-accent" aria-hidden="true"></i>
|
||||
{{ category.title }}
|
||||
</h3>
|
||||
|
||||
<!-- Intro Screen -->
|
||||
<section v-if="currentStep === 0" class="py-8 sm:py-10 lg:py-12 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="w-full max-w-3xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="card p-6 sm:p-8 lg:p-10 text-center">
|
||||
<div class="w-20 h-20 sm:w-24 sm:h-24 rounded-full bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center mx-auto mb-6 sm:mb-8 shadow-glow-purple">
|
||||
<i class="fas fa-tasks text-white text-2xl sm:text-4xl"></i>
|
||||
</div>
|
||||
<h2 class="text-xl sm:text-2xl lg:text-3xl font-bold text-gray-900 dark:text-gray-100 mb-3 sm:mb-4">
|
||||
How BEAT-Ready is Your Team?
|
||||
</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-6 sm:mb-8 leading-relaxed text-sm sm:text-base">
|
||||
Answer 12 quick questions about your current practices. We'll analyze your responses and show you specifically how BEAT principles can help your team.
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4 mb-6 sm:mb-8">
|
||||
<div v-for="cat in assessmentCategories" :key="cat.id" class="p-3 sm:p-4 rounded-xl" :class="colorClasses[cat.color].bg">
|
||||
<div
|
||||
class="w-10 h-10 sm:w-12 sm:h-12 rounded-lg sm:rounded-xl bg-gradient-to-br flex items-center justify-center mx-auto mb-2 sm:mb-3"
|
||||
:class="cat.gradient"
|
||||
<fieldset
|
||||
v-for="question in questionsFor(category.id)"
|
||||
:key="question.id"
|
||||
class="mt-5 border-t border-border pt-4"
|
||||
>
|
||||
<legend class="text-title font-semibold text-large">{{ question.question }}</legend>
|
||||
<div class="mt-3 grid grid-cols-1 gap-2 sm:grid-cols-2">
|
||||
<label
|
||||
v-for="option in question.options"
|
||||
:key="option.value"
|
||||
class="flex cursor-pointer items-start gap-2 border border-border px-3 py-2 text-body-base text-body hover:bg-muted"
|
||||
>
|
||||
<i :class="cat.icon" class="text-white text-base sm:text-xl"></i>
|
||||
</div>
|
||||
<div class="text-xs sm:text-sm text-gray-700 dark:text-gray-300 font-medium">{{ cat.title }}</div>
|
||||
<input
|
||||
v-model="answers[question.id]"
|
||||
type="radio"
|
||||
:name="`question-${question.id}`"
|
||||
:value="option.value"
|
||||
class="mt-1 h-4 w-4 accent-accent"
|
||||
/>
|
||||
<span>
|
||||
<span class="font-semibold text-large">{{ option.label }}</span>
|
||||
<span class="block text-muted-foreground">{{ option.description }}</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center justify-center gap-2 sm:gap-4 text-xs sm:text-sm text-gray-500 dark:text-gray-500 mb-6 sm:mb-8">
|
||||
<span class="flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-1.5 sm:py-2 rounded-full bg-gray-100 dark:bg-gray-800">
|
||||
<i class="fas fa-clock"></i> 3-5 min
|
||||
</span>
|
||||
<span class="flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-1.5 sm:py-2 rounded-full bg-gray-100 dark:bg-gray-800">
|
||||
<i class="fas fa-shield-alt"></i> Anonymous
|
||||
</span>
|
||||
<span class="flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-1.5 sm:py-2 rounded-full bg-gray-100 dark:bg-gray-800">
|
||||
<i class="fas fa-chart-bar"></i> Instant results
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button @click="startAssessment" class="btn-primary text-sm sm:text-base px-8 sm:px-10 py-3 sm:py-4">
|
||||
<i class="fas fa-play mr-2"></i>
|
||||
Start Assessment
|
||||
</button>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</PageSection>
|
||||
|
||||
<!-- Question Screen -->
|
||||
<section v-else-if="!showResults" class="py-6 sm:py-8 lg:py-10 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="w-full max-w-3xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<!-- Progress Bar -->
|
||||
<div class="mb-5 sm:mb-6">
|
||||
<div class="flex items-center justify-between text-xs sm:text-sm text-gray-600 dark:text-gray-400 mb-2">
|
||||
<span class="font-medium">Question {{ currentStep }} of {{ totalQuestions }}</span>
|
||||
<span>{{ progress }}% complete</span>
|
||||
</div>
|
||||
<div class="h-2.5 sm:h-3 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden">
|
||||
<div
|
||||
class="h-full bg-gradient-to-r from-indigo-500 to-purple-500 transition-all duration-500 ease-out rounded-full"
|
||||
:style="{ width: `${progress}%` }"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<PageSection title="Your result">
|
||||
<p v-if="!complete" class="text-body-base text-body">
|
||||
Some questions are still unanswered. Each category
|
||||
shows its recommendation once all of its questions are answered.
|
||||
</p>
|
||||
|
||||
<!-- Category Badge -->
|
||||
<div class="mb-4 sm:mb-6">
|
||||
<span
|
||||
class="inline-flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-1.5 sm:py-2 rounded-full text-xs sm:text-sm font-medium"
|
||||
:class="[colorClasses[assessmentCategories.find(c => c.id === currentQuestion.category)?.color || 'blue'].bg, colorClasses[assessmentCategories.find(c => c.id === currentQuestion.category)?.color || 'blue'].text]"
|
||||
>
|
||||
<i :class="assessmentCategories.find(c => c.id === currentQuestion.category)?.icon" class="text-xs"></i>
|
||||
{{ assessmentCategories.find(c => c.id === currentQuestion.category)?.title }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Question Card -->
|
||||
<div class="card p-5 sm:p-6 lg:p-8">
|
||||
<h2 class="text-base sm:text-lg lg:text-xl font-bold text-gray-900 dark:text-gray-100 mb-5 sm:mb-6">
|
||||
{{ currentQuestion.question }}
|
||||
</h2>
|
||||
|
||||
<div class="space-y-2.5 sm:space-y-3">
|
||||
<button
|
||||
v-for="option in currentQuestion.options"
|
||||
:key="option.value"
|
||||
@click="selectAnswer(currentQuestion.id, option.value)"
|
||||
class="w-full p-3 sm:p-4 lg:p-5 rounded-xl border-2 text-left transition-all duration-200 hover:shadow-md min-h-[64px] sm:min-h-[72px] group"
|
||||
:class="[
|
||||
answers[currentQuestion.id] === option.value
|
||||
? 'border-indigo-500 bg-indigo-50 dark:bg-indigo-900/20'
|
||||
: 'border-gray-200 dark:border-gray-700 hover:border-indigo-300 dark:hover:border-indigo-600'
|
||||
]"
|
||||
>
|
||||
<div class="flex items-start gap-3 sm:gap-4">
|
||||
<div
|
||||
class="w-5 h-5 sm:w-6 sm:h-6 rounded-full border-2 flex items-center justify-center flex-shrink-0 mt-0.5 transition-colors"
|
||||
:class="[
|
||||
answers[currentQuestion.id] === option.value
|
||||
? 'border-indigo-500 bg-indigo-500'
|
||||
: 'border-gray-300 dark:border-gray-600 group-hover:border-indigo-400'
|
||||
]"
|
||||
>
|
||||
<i v-if="answers[currentQuestion.id] === option.value" class="fas fa-check text-white text-xs"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="font-semibold text-gray-900 dark:text-gray-100 mb-0.5 sm:mb-1 text-sm sm:text-base">{{ option.label }}</div>
|
||||
<div class="text-xs sm:text-sm text-gray-500 dark:text-gray-500">{{ option.description }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between mt-5 sm:mt-6 pt-4 sm:pt-5 border-t border-gray-200 dark:border-gray-700">
|
||||
<button
|
||||
v-if="currentStep > 1"
|
||||
@click="goBack"
|
||||
class="text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 transition-colors px-3 sm:px-4 py-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 text-sm sm:text-base"
|
||||
>
|
||||
<i class="fas fa-arrow-left mr-2"></i>
|
||||
Back
|
||||
</button>
|
||||
<div v-else></div>
|
||||
|
||||
<div class="hidden sm:flex items-center gap-1.5">
|
||||
<div
|
||||
v-for="i in totalQuestions"
|
||||
:key="i"
|
||||
class="w-2 h-2 rounded-full transition-colors"
|
||||
:class="[
|
||||
i === currentStep ? 'bg-indigo-500' :
|
||||
answers[i] ? 'bg-indigo-300 dark:bg-indigo-700' :
|
||||
'bg-gray-300 dark:bg-gray-600'
|
||||
]"
|
||||
></div>
|
||||
</div>
|
||||
<div class="sm:hidden text-xs sm:text-sm text-gray-500 dark:text-gray-500">
|
||||
{{ currentStep }}/{{ totalQuestions }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6 space-y-8">
|
||||
<div v-for="category in assessmentCategories" :key="category.id">
|
||||
<template v-if="answeredIn(category.id) === questionsFor(category.id).length">
|
||||
<h3 class="flex items-center gap-2 text-heading font-semibold text-large">
|
||||
<i :class="category.icon" class="text-accent" aria-hidden="true"></i>
|
||||
{{ category.title }}
|
||||
</h3>
|
||||
<p class="mt-1 text-body-base text-body">
|
||||
{{ scoreFor(category.id) }} of {{ maxFor(category.id) }} points, level
|
||||
<strong class="text-large">{{ levelFor(category.id) }}</strong>.
|
||||
</p>
|
||||
<p class="mt-2 max-w-prose text-title font-semibold text-large">
|
||||
{{ beatRecommendations[category.id][levelFor(category.id)].title }}
|
||||
</p>
|
||||
<p class="mt-1 max-w-prose text-body-base text-body">
|
||||
{{ beatRecommendations[category.id][levelFor(category.id)].description }}
|
||||
</p>
|
||||
<ul class="mt-3 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li
|
||||
v-for="recommendation in beatRecommendations[category.id][levelFor(category.id)].recommendations"
|
||||
:key="recommendation"
|
||||
>
|
||||
{{ recommendation }}
|
||||
</li>
|
||||
</ul>
|
||||
<p class="mt-3 max-w-prose border-l-2 border-accent pl-3 text-body-base text-muted-foreground">
|
||||
{{ beatRecommendations[category.id][levelFor(category.id)].beatPrinciple }}
|
||||
</p>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Results Screen -->
|
||||
<section v-else class="py-6 sm:py-8 lg:py-10 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="w-full max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<!-- Overall Score -->
|
||||
<div class="card p-6 sm:p-8 lg:p-10 mb-6 sm:mb-8 text-center">
|
||||
<div
|
||||
class="w-16 h-16 sm:w-20 sm:h-20 lg:w-24 lg:h-24 rounded-full flex items-center justify-center mx-auto mb-4 sm:mb-6"
|
||||
:class="colorClasses[overallLevel.color].bg"
|
||||
>
|
||||
<i :class="[overallLevel.icon, colorClasses[overallLevel.color].text]" class="text-2xl sm:text-3xl lg:text-4xl"></i>
|
||||
</div>
|
||||
<h2 class="text-lg sm:text-xl lg:text-2xl font-bold text-gray-900 dark:text-gray-100 mb-2">
|
||||
{{ overallLevel.title }}
|
||||
</h2>
|
||||
<div class="text-2xl sm:text-3xl lg:text-4xl font-bold gradient-text mb-3 sm:mb-4">
|
||||
{{ totalScore }} / 48
|
||||
</div>
|
||||
<p class="text-gray-600 dark:text-gray-400 max-w-xl mx-auto mb-3 sm:mb-4 text-sm sm:text-base">
|
||||
{{ overallLevel.description }}
|
||||
</p>
|
||||
<div
|
||||
class="inline-flex items-center gap-2 px-4 sm:px-5 py-2 sm:py-2.5 rounded-xl"
|
||||
:class="[colorClasses[overallLevel.color].bg, colorClasses[overallLevel.color].border]"
|
||||
>
|
||||
<i class="fas fa-lightbulb" :class="colorClasses[overallLevel.color].text"></i>
|
||||
<span class="font-medium text-sm sm:text-base" :class="colorClasses[overallLevel.color].text">{{ overallLevel.callToAction }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Category Breakdown -->
|
||||
<h3 class="text-base sm:text-lg lg:text-xl font-bold text-gray-900 dark:text-gray-100 mb-4 sm:mb-5 flex items-center gap-2 sm:gap-3">
|
||||
<div class="w-0.5 sm:w-1 h-5 sm:h-6 rounded-full bg-gradient-to-b from-indigo-500 to-purple-500"></div>
|
||||
Category Breakdown
|
||||
<div v-if="overallBand" class="mt-10 border-t border-border pt-6">
|
||||
<h3 class="flex items-center gap-2 text-heading font-semibold text-large">
|
||||
<i :class="overallBand.icon" class="text-accent" aria-hidden="true"></i>
|
||||
Overall: {{ totalScore }} of {{ overallAssessment.scoring.maxScore }}
|
||||
</h3>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4 mb-6 sm:mb-8">
|
||||
<div
|
||||
v-for="cat in assessmentCategories"
|
||||
:key="cat.id"
|
||||
class="card p-4 sm:p-5"
|
||||
>
|
||||
<div class="flex items-center gap-3 sm:gap-4 mb-3 sm:mb-4">
|
||||
<div
|
||||
class="w-10 h-10 sm:w-12 sm:h-12 rounded-lg sm:rounded-xl bg-gradient-to-br flex items-center justify-center"
|
||||
:class="cat.gradient"
|
||||
>
|
||||
<i :class="cat.icon" class="text-white text-base sm:text-lg"></i>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="font-semibold text-gray-900 dark:text-gray-100 text-sm sm:text-base truncate">{{ cat.title }}</div>
|
||||
<div class="text-xs sm:text-sm" :class="colorClasses[cat.color].text">
|
||||
{{ categoryScores[cat.id]?.percentage }}% ({{ categoryScores[cat.id]?.score }}/{{ categoryScores[cat.id]?.max }})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-2 sm:h-2.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden">
|
||||
<div
|
||||
class="h-full rounded-full transition-all duration-1000"
|
||||
:class="colorClasses[cat.color].progress"
|
||||
:style="{ width: `${categoryScores[cat.id]?.percentage}%` }"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Detailed Recommendations -->
|
||||
<h3 class="text-base sm:text-lg lg:text-xl font-bold text-gray-900 dark:text-gray-100 mb-4 sm:mb-5 flex items-center gap-2 sm:gap-3">
|
||||
<div class="w-0.5 sm:w-1 h-5 sm:h-6 rounded-full bg-gradient-to-b from-emerald-500 to-teal-500"></div>
|
||||
How BEAT Can Help
|
||||
</h3>
|
||||
<div class="space-y-4 sm:space-y-5 mb-6 sm:mb-8">
|
||||
<div
|
||||
v-for="cat in assessmentCategories"
|
||||
:key="cat.id"
|
||||
class="card p-4 sm:p-5 lg:p-6"
|
||||
>
|
||||
<div class="flex items-start gap-3 sm:gap-4 mb-3 sm:mb-4">
|
||||
<div
|
||||
class="w-10 h-10 sm:w-12 sm:h-12 rounded-lg sm:rounded-xl bg-gradient-to-br flex items-center justify-center flex-shrink-0"
|
||||
:class="cat.gradient"
|
||||
>
|
||||
<i :class="cat.icon" class="text-white text-base sm:text-lg"></i>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<h4 class="font-bold text-gray-900 dark:text-gray-100 text-sm sm:text-base lg:text-lg">{{ getRecommendation(cat.id).title }}</h4>
|
||||
<p class="text-gray-600 dark:text-gray-400 mt-0.5 sm:mt-1 text-xs sm:text-sm">{{ getRecommendation(cat.id).description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-1.5 sm:space-y-2 mb-3 sm:mb-4">
|
||||
<div
|
||||
v-for="rec in getRecommendation(cat.id).recommendations"
|
||||
:key="rec"
|
||||
class="flex items-start gap-2 sm:gap-3 p-2.5 sm:p-3 rounded-lg"
|
||||
:class="colorClasses[cat.color].bg"
|
||||
>
|
||||
<i class="fas fa-check-circle mt-0.5 text-xs sm:text-sm" :class="colorClasses[cat.color].text"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300 text-xs sm:text-sm">{{ rec }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-start gap-2 sm:gap-3 p-3 sm:p-4 rounded-lg bg-gray-50 dark:bg-gray-800 border-l-4" :class="colorClasses[cat.color].border">
|
||||
<i class="fas fa-quote-left text-gray-400 mt-0.5 text-xs sm:text-sm"></i>
|
||||
<p class="text-gray-600 dark:text-gray-400 italic text-xs sm:text-sm">{{ getRecommendation(cat.id).beatPrinciple }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CTA -->
|
||||
<div class="p-6 sm:p-8 lg:p-10 rounded-2xl sm:rounded-3xl bg-gradient-to-br from-indigo-600 via-purple-600 to-pink-600 text-center">
|
||||
<h3 class="text-lg sm:text-xl lg:text-2xl font-bold text-white mb-2 sm:mb-3">Ready to Transform Your Team?</h3>
|
||||
<p class="text-white/80 mb-4 sm:mb-6 max-w-xl mx-auto text-sm sm:text-base">
|
||||
Explore the full BEAT manifesto and start implementing these practices today.
|
||||
</p>
|
||||
<div class="flex flex-col sm:flex-row gap-2 sm:gap-3 justify-center">
|
||||
<RouterLink to="/values" class="bg-white text-indigo-600 px-5 sm:px-6 py-2.5 sm:py-3 rounded-lg font-semibold hover:bg-gray-100 transition-colors min-h-[48px] flex items-center justify-center text-sm sm:text-base">
|
||||
<i class="fas fa-book-open mr-2"></i>
|
||||
Read the Manifesto
|
||||
</RouterLink>
|
||||
<button @click="restartAssessment" class="bg-white/20 text-white px-5 sm:px-6 py-2.5 sm:py-3 rounded-lg font-semibold hover:bg-white/30 transition-colors min-h-[48px] flex items-center justify-center text-sm sm:text-base">
|
||||
<i class="fas fa-redo mr-2"></i>
|
||||
Retake Assessment
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-1 text-title font-semibold text-large">{{ overallBand.title }}</p>
|
||||
<p class="mt-1 max-w-prose text-body-base text-body">{{ overallBand.description }}</p>
|
||||
<p class="mt-2 max-w-prose text-body-base text-body">{{ overallBand.callToAction }}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="mt-8 inline-flex min-h-[44px] items-center border border-border px-4 py-2 text-body-base font-semibold text-large hover:bg-muted"
|
||||
@click="reset"
|
||||
>
|
||||
Clear answers
|
||||
</button>
|
||||
</PageSection>
|
||||
|
||||
<PageSection title="How the score is calculated" :summary="overallAssessment.scoring.categoryThresholds">
|
||||
<p class="max-w-prose text-body-base text-body">{{ overallAssessment.scoring.derivation }}</p>
|
||||
<p class="mt-4 max-w-prose text-body-base text-body">{{ overallAssessment.validity.note }}</p>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,264 +1,75 @@
|
||||
<script setup>
|
||||
import { roles, priorityBuckets, ceremonies, constraints } from '@/data/manifesto'
|
||||
import {
|
||||
ceremonies,
|
||||
constraints,
|
||||
decisionRules,
|
||||
framework,
|
||||
priorityBuckets,
|
||||
roles
|
||||
} from '@/data/manifesto'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
import TableCard from '@/components/ui/TableCard.vue'
|
||||
|
||||
const workItems = [
|
||||
{ name: 'Tasks', time: 'hours', description: 'A one-liner. No ceremony needed.', icon: 'fas fa-check', color: 'blue' },
|
||||
{ name: 'Work Items', time: 'days', description: 'Title, context, done condition. Three lines.', icon: 'fas fa-tasks', color: 'purple' },
|
||||
{ name: 'Projects', time: 'week+', description: 'Half-page doc with breakdown. No more.', icon: 'fas fa-folder', color: 'emerald' }
|
||||
]
|
||||
|
||||
const bucketColors = {
|
||||
red: 'from-red-500 to-red-600 border-red-500 shadow-glow-red',
|
||||
amber: 'from-amber-500 to-amber-600 border-amber-500',
|
||||
blue: 'from-blue-500 to-blue-600 border-blue-500 shadow-glow-blue',
|
||||
gray: 'from-gray-500 to-gray-600 border-gray-500'
|
||||
}
|
||||
|
||||
const boardColumns = [
|
||||
{ name: 'ICE', color: 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400', icon: 'fas fa-snowflake' },
|
||||
{ name: 'LATER', color: 'bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300', icon: 'fas fa-clock' },
|
||||
{ name: 'NEXT', color: 'bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300', icon: 'fas fa-arrow-up' },
|
||||
{ name: 'IN PROGRESS', color: 'bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300', icon: 'fas fa-spinner' },
|
||||
{ name: 'DONE', color: 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300', icon: 'fas fa-check-circle' }
|
||||
]
|
||||
const ceremonyRows = ceremonies.map((ceremony) => [ceremony.name, ceremony.duration, ceremony.purpose])
|
||||
const constraintRows = constraints.map((item) => [item.constraint, item.limit])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-32 sm:pt-40 pb-16 sm:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-purple-50 via-indigo-50 to-blue-50 dark:from-gray-900 dark:via-purple-950/20 dark:to-indigo-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-96 h-96 bg-purple-400/20 dark:bg-purple-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-80 h-80 bg-indigo-400/20 dark:bg-indigo-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader eyebrow="The Method" title="The Framework" :summary="framework.summary" />
|
||||
|
||||
<div class="relative max-w-6xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300 text-sm font-medium mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-sitemap"></i>
|
||||
Implementation
|
||||
<PageSection title="Roles" summary="A role states what the person decides and what they do not decide.">
|
||||
<dl class="space-y-6">
|
||||
<div v-for="role in roles" :key="role.name">
|
||||
<dt class="flex items-center gap-2 text-title font-semibold text-large">
|
||||
<i :class="role.icon" class="text-accent" aria-hidden="true"></i>
|
||||
{{ role.name }}
|
||||
</dt>
|
||||
<dd class="mt-1 max-w-prose text-body-base text-body">{{ role.description }}</dd>
|
||||
</div>
|
||||
<div class="w-20 h-20 rounded-2xl bg-gradient-to-br from-purple-500 to-indigo-500 flex items-center justify-center mx-auto mb-8 animate-fade-in-up animate-delay-100 shadow-glow-purple">
|
||||
<i class="fas fa-sitemap text-white text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">The Framework</h1>
|
||||
<p class="section-subtitle max-w-2xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
The principles guide us. The framework implements them.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</dl>
|
||||
</PageSection>
|
||||
|
||||
<!-- Roles -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Roles</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">We recognize three roles, loosely held.</p>
|
||||
</div>
|
||||
<PageSection title="Beats and ceremonies" summary="A beat is the planning cycle. These are the meetings inside it.">
|
||||
<TableCard :headers="['Ceremony', 'Duration', 'Purpose']" :rows="ceremonyRows" />
|
||||
</PageSection>
|
||||
|
||||
<div class="grid md:grid-cols-3 gap-6">
|
||||
<div
|
||||
v-for="(role, index) in roles"
|
||||
:key="role.name"
|
||||
class="card group p-8 text-center"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div
|
||||
class="w-20 h-20 rounded-2xl bg-gradient-to-br flex items-center justify-center mx-auto mb-6 group-hover:scale-110 group-hover:rotate-3 transition-all duration-300 shadow-lg"
|
||||
:class="role.gradient"
|
||||
>
|
||||
<i :class="role.icon" class="text-white text-2xl"></i>
|
||||
</div>
|
||||
<h3 class="text-2xl font-bold text-gray-900 dark:text-gray-100 mb-4">{{ role.name }}</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 leading-relaxed">{{ role.description }}</p>
|
||||
</div>
|
||||
<PageSection title="Priority buckets" summary="The board orders work in four buckets. The order is the Enabler's; the pull is the maker's.">
|
||||
<dl class="space-y-4">
|
||||
<div v-for="bucket in priorityBuckets" :key="bucket.name" class="border-l-2 border-accent pl-3">
|
||||
<dt class="text-title font-semibold text-large">{{ bucket.name }}</dt>
|
||||
<dd class="text-body-base text-body">{{ bucket.description }}</dd>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</dl>
|
||||
</PageSection>
|
||||
|
||||
<!-- Beats -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300 relative overflow-hidden">
|
||||
<div class="absolute top-0 right-0 w-96 h-96 bg-blue-500/5 dark:bg-blue-500/10 rounded-full filter blur-3xl"></div>
|
||||
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6 relative">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Beats</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400 max-w-2xl mx-auto">
|
||||
We work in beats—flexible iterations of one to two weeks.
|
||||
</p>
|
||||
</div>
|
||||
<PageSection title="Planning numbers" summary="Every limit below is a BEAT default, not a research finding.">
|
||||
<TableCard :headers="['Constraint', 'Limit']" :rows="constraintRows" />
|
||||
</PageSection>
|
||||
|
||||
<div class="glass p-8 sm:p-10 rounded-3xl">
|
||||
<!-- Timeline -->
|
||||
<div class="grid md:grid-cols-3 gap-8 relative">
|
||||
<!-- Connecting line -->
|
||||
<div class="hidden md:block absolute top-12 left-0 right-0 h-0.5 bg-gradient-to-r from-blue-500 via-purple-500 to-emerald-500"></div>
|
||||
|
||||
<div class="text-center relative">
|
||||
<div class="w-24 h-24 rounded-full bg-gradient-to-br from-blue-500 to-cyan-500 flex items-center justify-center mx-auto mb-6 relative z-10 shadow-glow-blue group-hover:scale-110 transition-transform">
|
||||
<i class="fas fa-play text-white text-2xl"></i>
|
||||
<PageSection title="Decision rules" summary="Every rule states what it applies to, who decides, and what to do when it does not fit.">
|
||||
<dl class="space-y-6">
|
||||
<div v-for="rule in decisionRules" :key="rule.rule">
|
||||
<dt class="text-title font-semibold text-large">{{ rule.rule }}</dt>
|
||||
<dd class="mt-1">
|
||||
<dl class="space-y-1 text-body-base text-body">
|
||||
<div>
|
||||
<dt class="font-semibold text-muted-foreground">Applies to</dt>
|
||||
<dd>{{ rule.appliesTo }}</dd>
|
||||
</div>
|
||||
<h4 class="font-bold text-xl text-gray-900 dark:text-gray-100 mb-2">Beat Start</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">Review priorities and pull initial work</p>
|
||||
</div>
|
||||
<div class="text-center relative">
|
||||
<div class="w-24 h-24 rounded-full bg-gradient-to-br from-purple-500 to-pink-500 flex items-center justify-center mx-auto mb-6 relative z-10 shadow-glow-purple">
|
||||
<i class="fas fa-cogs text-white text-2xl"></i>
|
||||
<div>
|
||||
<dt class="font-semibold text-muted-foreground">Decided by</dt>
|
||||
<dd>{{ rule.decidedBy }}</dd>
|
||||
</div>
|
||||
<h4 class="font-bold text-xl text-gray-900 dark:text-gray-100 mb-2">During Beat</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">Check in async daily, work autonomously</p>
|
||||
</div>
|
||||
<div class="text-center relative">
|
||||
<div class="w-24 h-24 rounded-full bg-gradient-to-br from-emerald-500 to-teal-500 flex items-center justify-center mx-auto mb-6 relative z-10">
|
||||
<i class="fas fa-flag-checkered text-white text-2xl"></i>
|
||||
<div>
|
||||
<dt class="font-semibold text-muted-foreground">If it does not fit</dt>
|
||||
<dd>{{ rule.ifItDoesNotFit }}</dd>
|
||||
</div>
|
||||
<h4 class="font-bold text-xl text-gray-900 dark:text-gray-100 mb-2">Beat Close</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">Reflect: what worked, what didn't, what to improve</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-10 p-5 rounded-xl bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800">
|
||||
<p class="text-sm text-blue-800 dark:text-blue-200 flex items-start gap-3">
|
||||
<i class="fas fa-info-circle mt-0.5"></i>
|
||||
<span>Beats have <strong>goals</strong>, not commitments. We aim; we do not promise. There is no sprint pressure, no velocity tracking, no burndown theater.</span>
|
||||
</p>
|
||||
</div>
|
||||
</dl>
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Work Items -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Work Items</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Documentation effort scales with task size.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid md:grid-cols-3 gap-6">
|
||||
<div
|
||||
v-for="(item, index) in workItems"
|
||||
:key="item.name"
|
||||
class="card group p-8"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-center gap-4 mb-4">
|
||||
<div
|
||||
class="w-14 h-14 rounded-xl bg-gradient-to-br flex items-center justify-center group-hover:scale-110 transition-all duration-300"
|
||||
:class="[
|
||||
item.color === 'blue' ? 'from-blue-500 to-blue-600' :
|
||||
item.color === 'purple' ? 'from-purple-500 to-purple-600' :
|
||||
'from-emerald-500 to-emerald-600'
|
||||
]"
|
||||
>
|
||||
<i :class="item.icon" class="text-white text-xl"></i>
|
||||
</div>
|
||||
<span class="text-2xl font-bold gradient-text">{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="inline-block px-4 py-1.5 rounded-full bg-gray-100 dark:bg-gray-700 text-sm text-gray-600 dark:text-gray-400 mb-4 font-medium">
|
||||
{{ item.time }}
|
||||
</div>
|
||||
<p class="text-gray-600 dark:text-gray-400">{{ item.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 text-center">
|
||||
<p class="text-gray-500 dark:text-gray-500">
|
||||
We size with <strong class="text-gray-700 dark:text-gray-300">S/M/L</strong>, not story points. We do not groom. We do not point. We do not track velocity.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Prioritization -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Prioritization Buckets</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">We use four buckets to organize work.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-5">
|
||||
<div
|
||||
v-for="(bucket, index) in priorityBuckets"
|
||||
:key="bucket.name"
|
||||
class="card p-6 border-l-4"
|
||||
:class="bucketColors[bucket.color]"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100 mb-3">{{ bucket.name }}</h3>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 leading-relaxed">{{ bucket.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- The Board -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">The Board</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">A simple kanban with priority built in.</p>
|
||||
</div>
|
||||
|
||||
<!-- Visual Board Flow -->
|
||||
<div class="glass p-6 sm:p-8 rounded-3xl overflow-x-auto mb-8">
|
||||
<div class="flex items-center justify-start sm:justify-center gap-3 min-w-max sm:min-w-0">
|
||||
<template v-for="(col, index) in boardColumns" :key="col.name">
|
||||
<div
|
||||
class="flex items-center gap-2 px-4 py-3 rounded-xl font-medium"
|
||||
:class="col.color"
|
||||
>
|
||||
<i :class="col.icon" class="text-sm"></i>
|
||||
<span class="text-sm">{{ col.name }}</span>
|
||||
</div>
|
||||
<i v-if="index < boardColumns.length - 1" class="fas fa-arrow-right text-gray-400"></i>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-3 gap-5">
|
||||
<div class="card p-6 text-center group">
|
||||
<div class="w-14 h-14 rounded-xl bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform">
|
||||
<i class="fas fa-user text-blue-500 text-xl"></i>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-900 dark:text-gray-100 block mb-1">WIP Limit</span>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">3 items per maker</p>
|
||||
</div>
|
||||
<div class="card p-6 text-center group">
|
||||
<div class="w-14 h-14 rounded-xl bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform">
|
||||
<i class="fas fa-sort-amount-up text-purple-500 text-xl"></i>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-900 dark:text-gray-100 block mb-1">NEXT is Ordered</span>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">Pull from top</p>
|
||||
</div>
|
||||
<div class="card p-6 text-center group">
|
||||
<div class="w-14 h-14 rounded-xl bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center mx-auto mb-4 group-hover:scale-110 transition-transform">
|
||||
<i class="fas fa-clock text-amber-500 text-xl"></i>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-900 dark:text-gray-100 block mb-1">Stale Items</span>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">Return to backlog after 5 days</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Constraints -->
|
||||
<section class="py-20 relative overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-purple-600 via-indigo-600 to-blue-600"></div>
|
||||
|
||||
<div class="relative max-w-5xl mx-auto px-4 sm:px-6">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-white text-center mb-12">The Numbers</h2>
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-5">
|
||||
<div
|
||||
v-for="(item, index) in constraints"
|
||||
:key="item.constraint"
|
||||
class="bg-white/10 backdrop-blur-sm p-5 rounded-2xl border border-white/10 hover:bg-white/20 transition-all duration-300"
|
||||
:style="{ animationDelay: `${index * 50}ms` }"
|
||||
>
|
||||
<div class="text-white/70 text-sm mb-1">{{ item.constraint }}</div>
|
||||
<div class="text-white text-2xl font-bold">{{ item.limit }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</dl>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+103
-239
@@ -1,259 +1,123 @@
|
||||
<script setup>
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { researchStats } from '@/data/manifesto'
|
||||
import { sections } from '@/router'
|
||||
import { pagesInSection } from '@/router/sections'
|
||||
import { coreValues, principles, researchStats } from '@/data/manifesto'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
|
||||
const navCards = [
|
||||
{ path: '/values', title: 'Values', description: 'Core & team values that guide everything', icon: 'fas fa-heart', gradient: 'from-rose-500 to-pink-500', color: 'rose' },
|
||||
{ path: '/principles', title: 'Principles', description: 'The 12 principles of BEAT', icon: 'fas fa-compass', gradient: 'from-blue-500 to-cyan-500', color: 'blue' },
|
||||
{ path: '/framework', title: 'Framework', description: 'Roles, beats, and the board', icon: 'fas fa-sitemap', gradient: 'from-purple-500 to-indigo-500', color: 'purple' },
|
||||
{ path: '/practices', title: 'Practices', description: 'Meetings, collaboration, incidents', icon: 'fas fa-cogs', gradient: 'from-emerald-500 to-teal-500', color: 'emerald' },
|
||||
{ path: '/onboarding', title: 'Onboarding', description: 'Getting started with BEAT', icon: 'fas fa-user-plus', gradient: 'from-amber-500 to-orange-500', color: 'amber' },
|
||||
{ path: '/reference', title: 'Reference', description: 'Quick lookup tables', icon: 'fas fa-book', gradient: 'from-cyan-500 to-sky-500', color: 'cyan' }
|
||||
]
|
||||
|
||||
const keyNumbers = [
|
||||
{ value: '4hrs', label: 'Sacred Focus Block', icon: 'fas fa-brain', color: 'blue' },
|
||||
{ value: '2hrs', label: 'Max Meetings/Week', icon: 'fas fa-calendar', color: 'purple' },
|
||||
{ value: '80%', label: 'Planning Capacity', icon: 'fas fa-battery-three-quarters', color: 'emerald' },
|
||||
{ value: '20%', label: 'Exploration Time', icon: 'fas fa-flask', color: 'amber' }
|
||||
]
|
||||
const principleCount = Object.values(principles).reduce((total, group) => total + group.length, 0)
|
||||
const orderedSections = [...sections].sort((a, b) => a.order - b.order)
|
||||
const sectionPath = (sectionId) => pagesInSection(sectionId)[0]?.path ?? '/'
|
||||
|
||||
// The five commitments of README "The BEAT Commitment". public/src/data has no
|
||||
// commitments key and is owned by another card, so the list lives here; the
|
||||
// weak-point record (WP-49) names this file as the place that carries all five.
|
||||
const commitments = [
|
||||
{ icon: 'fas fa-shield-alt', title: 'Protecting focus', description: 'We will not interrupt sacred time. We will wait.' },
|
||||
{ icon: 'fas fa-pen', title: 'Defaulting to async', description: 'We will write first, meet only when writing fails.' },
|
||||
{ icon: 'fas fa-handshake', title: 'Trusting makers', description: 'We will provide goals, not instructions. Constraints, not control.' },
|
||||
{ icon: 'fas fa-heart', title: 'Sustaining pace', description: 'We will cut scope before we cut rest. We will plan for humans.' },
|
||||
{
|
||||
icon: 'fas fa-shield-alt',
|
||||
title: 'Protecting focus',
|
||||
description: 'We will not interrupt sacred time. We will wait. The one exception is a declared incident, and the incident lead decides when the block resumes.'
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-pen',
|
||||
title: 'Defaulting to async',
|
||||
description: 'We will write first, meet only when writing fails.'
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-handshake',
|
||||
title: 'Trusting makers',
|
||||
description: 'We will provide goals, not instructions. Constraints, not control.'
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-heart',
|
||||
title: 'Sustaining pace',
|
||||
description: 'We will cut scope before we cut rest. We will plan for humans, not machines.'
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-arrows-rotate',
|
||||
title: 'Improving always',
|
||||
description: 'We will reflect each beat. We will adjust. We will find better ways.'
|
||||
}
|
||||
]
|
||||
|
||||
// The data carries the citation id in brackets at the end of the description;
|
||||
// the page renders it once, as a link to the reference entry.
|
||||
const withoutCitation = (description) => description.replace(/\s*\[[^\]]+\]\s*$/, '')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero Section -->
|
||||
<section class="relative min-h-[85vh] sm:min-h-[90vh] flex items-center justify-center overflow-hidden">
|
||||
<!-- Animated background blobs -->
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-blue-50 via-purple-50 to-cyan-50 dark:from-gray-900 dark:via-blue-950/30 dark:to-purple-950/30 transition-colors duration-500"></div>
|
||||
|
||||
<!-- Floating orbs - responsive sizing -->
|
||||
<div class="absolute top-20 left-[5%] w-48 h-48 sm:w-72 sm:h-72 lg:w-96 lg:h-96 bg-blue-400/20 dark:bg-blue-500/20 rounded-full mix-blend-multiply dark:mix-blend-soft-light filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 right-[5%] w-56 h-56 sm:w-80 sm:h-80 lg:w-[28rem] lg:h-[28rem] bg-purple-400/20 dark:bg-purple-500/20 rounded-full mix-blend-multiply dark:mix-blend-soft-light filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<div class="absolute -bottom-10 left-1/4 w-52 h-52 sm:w-72 sm:h-72 lg:w-80 lg:h-80 bg-cyan-400/20 dark:bg-cyan-500/20 rounded-full mix-blend-multiply dark:mix-blend-soft-light filter blur-3xl animate-float animate-delay-1000"></div>
|
||||
|
||||
<!-- Grid pattern overlay -->
|
||||
<div class="absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiM5Y2EzYWYiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTM2IDM0aDR2NGgtNHpNMjQgMjRoNHY0aC00eiIvPjwvZz48L2c+PC9zdmc+')] opacity-50"></div>
|
||||
<PageHeader
|
||||
eyebrow="Start"
|
||||
title="The BEAT Manifesto"
|
||||
:summary="`The method states ${coreValues.length} core values and ${principleCount} principles. This site reads it in ${orderedSections.length} sections, in reading order.`"
|
||||
/>
|
||||
|
||||
<div class="relative w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 py-16 sm:py-20 lg:py-24">
|
||||
<div class="text-center">
|
||||
<!-- Logo with glow effect -->
|
||||
<div class="mb-6 sm:mb-8 flex justify-center animate-fade-in-up">
|
||||
<div
|
||||
class="relative w-20 h-20 sm:w-28 sm:h-28 lg:w-36 lg:h-36 rounded-2xl bg-gradient-to-br from-blue-600 via-purple-600 to-cyan-600 flex items-center justify-center shadow-2xl animate-float"
|
||||
<PageSection
|
||||
title="What we value more"
|
||||
summary="Each value names what it prefers over what it gives up."
|
||||
>
|
||||
<ul class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<li v-for="value in coreValues" :key="value.valueMore" class="flex gap-3 border-l-2 border-accent pl-3">
|
||||
<i :class="value.icon" class="mt-1 text-accent" aria-hidden="true"></i>
|
||||
<p class="text-body-base text-body">
|
||||
<span class="font-semibold text-large">{{ value.valueMore }}</span> over {{ value.over }}
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</PageSection>
|
||||
|
||||
<PageSection
|
||||
title="What the research says"
|
||||
summary="Each figure carries the id of the work it comes from. The full entries are on the Quick Reference page."
|
||||
>
|
||||
<dl class="space-y-4">
|
||||
<div v-for="item in researchStats" :key="item.citation + item.stat" class="border-l-2 border-border pl-3">
|
||||
<dt class="text-heading font-semibold text-large">{{ item.stat }}</dt>
|
||||
<dd class="text-body-base text-body">
|
||||
{{ withoutCitation(item.description) }}
|
||||
<RouterLink
|
||||
to="/reference"
|
||||
class="font-mono text-body-base text-accent underline underline-offset-4"
|
||||
>
|
||||
<!-- Glow effect -->
|
||||
<div class="absolute inset-0 rounded-2xl bg-gradient-to-br from-blue-600 via-purple-600 to-cyan-600 blur-xl opacity-50 animate-pulse-slow"></div>
|
||||
<span class="relative text-white text-3xl sm:text-5xl lg:text-6xl font-bold">B</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Title - responsive sizing -->
|
||||
<h1 class="text-4xl sm:text-5xl md:text-6xl lg:text-7xl xl:text-8xl font-bold text-gray-900 dark:text-gray-100 mb-4 sm:mb-6 leading-tight animate-fade-in-up animate-delay-100">
|
||||
The <span class="gradient-text">BEAT</span> Manifesto
|
||||
</h1>
|
||||
|
||||
<!-- Subtitle -->
|
||||
<p class="text-xl sm:text-2xl md:text-3xl lg:text-4xl text-gray-700 dark:text-gray-200 mb-4 sm:mb-6 animate-fade-in-up animate-delay-200 font-medium tracking-tight">
|
||||
<span class="text-blue-600 dark:text-blue-400">B</span>alanced.
|
||||
<span class="text-purple-600 dark:text-purple-400">E</span>mpowered.
|
||||
<span class="text-cyan-600 dark:text-cyan-400">A</span>sync.
|
||||
<span class="text-pink-600 dark:text-pink-400">T</span>eams.
|
||||
</p>
|
||||
|
||||
<!-- Description -->
|
||||
<p class="text-base sm:text-lg lg:text-xl text-gray-600 dark:text-gray-400 mb-8 sm:mb-10 max-w-2xl lg:max-w-3xl mx-auto animate-fade-in-up animate-delay-300 leading-relaxed px-4 sm:px-0">
|
||||
A software delivery methodology built for how developers actually work.
|
||||
<span class="block mt-2 text-gray-500 dark:text-gray-500">Created by <strong class="text-gray-700 dark:text-gray-300">Lukasz Raczylo</strong>.</span>
|
||||
</p>
|
||||
|
||||
<!-- CTA Buttons - stack on mobile, side by side on larger screens -->
|
||||
<div class="flex flex-col sm:flex-row gap-3 sm:gap-4 justify-center animate-fade-in-up animate-delay-400 px-4 sm:px-0">
|
||||
<RouterLink to="/values" class="btn-primary text-sm sm:text-base px-6 sm:px-8 py-3 sm:py-4">
|
||||
<i class="fas fa-book-open mr-2"></i>
|
||||
Start Reading
|
||||
</RouterLink>
|
||||
<RouterLink to="/assessment" class="btn-secondary text-sm sm:text-base px-6 sm:px-8 py-3 sm:py-4">
|
||||
<i class="fas fa-clipboard-check mr-2"></i>
|
||||
Take Assessment
|
||||
{{ item.citation }}
|
||||
</RouterLink>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</PageSection>
|
||||
|
||||
<PageSection title="The BEAT Commitment" summary="By adopting BEAT, the team commits to these five things.">
|
||||
<ul class="grid grid-cols-1 gap-6 sm:grid-cols-2">
|
||||
<li v-for="item in commitments" :key="item.title" class="flex gap-3">
|
||||
<i :class="item.icon" class="mt-1 text-accent" aria-hidden="true"></i>
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">{{ item.title }}</h3>
|
||||
<p class="mt-1 max-w-prose text-body-base text-body">{{ item.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</PageSection>
|
||||
|
||||
<!-- Scroll indicator - hide on very small screens -->
|
||||
<div class="absolute bottom-4 sm:bottom-8 left-1/2 -translate-x-1/2 animate-bounce-subtle hidden sm:block">
|
||||
<div class="w-6 h-10 rounded-full border-2 border-gray-400 dark:border-gray-600 flex items-start justify-center p-2">
|
||||
<div class="w-1.5 h-3 rounded-full bg-gray-400 dark:bg-gray-600 animate-pulse"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Key Numbers -->
|
||||
<section class="py-12 sm:py-16 lg:py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12">
|
||||
<div class="grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4 lg:gap-6">
|
||||
<div
|
||||
v-for="(item, index) in keyNumbers"
|
||||
:key="item.label"
|
||||
class="group card text-center p-4 sm:p-6 lg:p-8"
|
||||
:class="`hover:border-${item.color}-300 dark:hover:border-${item.color}-700`"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div
|
||||
class="w-10 h-10 sm:w-12 sm:h-12 lg:w-14 lg:h-14 rounded-xl sm:rounded-2xl bg-gradient-to-br flex items-center justify-center mx-auto mb-3 sm:mb-4 transition-all duration-300 group-hover:scale-110 group-hover:rotate-3"
|
||||
:class="[
|
||||
item.color === 'blue' ? 'from-blue-500 to-blue-600 shadow-glow-blue' :
|
||||
item.color === 'purple' ? 'from-purple-500 to-purple-600 shadow-glow-purple' :
|
||||
item.color === 'emerald' ? 'from-emerald-500 to-emerald-600' :
|
||||
'from-amber-500 to-amber-600'
|
||||
]"
|
||||
>
|
||||
<i :class="item.icon" class="text-white text-base sm:text-xl lg:text-2xl"></i>
|
||||
</div>
|
||||
<div class="text-2xl sm:text-3xl lg:text-4xl xl:text-5xl font-bold gradient-text mb-1 sm:mb-2">{{ item.value }}</div>
|
||||
<div class="text-xs sm:text-sm text-gray-600 dark:text-gray-400 font-medium">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Introduction -->
|
||||
<section class="py-12 sm:py-16 lg:py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300 relative overflow-hidden">
|
||||
<!-- Decorative elements -->
|
||||
<div class="absolute top-0 right-0 w-48 h-48 sm:w-64 sm:h-64 bg-blue-500/5 dark:bg-blue-500/10 rounded-full filter blur-3xl"></div>
|
||||
<div class="absolute bottom-0 left-0 w-48 h-48 sm:w-64 sm:h-64 bg-purple-500/5 dark:bg-purple-500/10 rounded-full filter blur-3xl"></div>
|
||||
|
||||
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 relative">
|
||||
<div class="glass p-6 sm:p-8 lg:p-12 xl:p-16 rounded-2xl sm:rounded-3xl">
|
||||
<div class="flex items-center gap-3 mb-4 sm:mb-6">
|
||||
<div class="w-1 h-6 sm:h-8 rounded-full bg-gradient-to-b from-blue-500 to-purple-500"></div>
|
||||
<h2 class="text-xl sm:text-2xl font-bold text-gray-900 dark:text-gray-100">Our Philosophy</h2>
|
||||
</div>
|
||||
|
||||
<p class="text-lg sm:text-xl lg:text-2xl text-gray-700 dark:text-gray-300 leading-relaxed mb-4 sm:mb-6 font-light">
|
||||
We are uncovering better ways of building software by doing it and helping others do it.
|
||||
</p>
|
||||
<p class="text-gray-600 dark:text-gray-400 leading-relaxed mb-6 sm:mb-8 text-sm sm:text-base">
|
||||
BEAT emerges from research on how developers actually work. We built it for these realities, not against them.
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4">
|
||||
<div
|
||||
v-for="(stat, index) in researchStats"
|
||||
:key="stat.stat"
|
||||
class="flex items-center gap-3 p-3 sm:p-4 rounded-xl bg-white/60 dark:bg-gray-700/50 hover:bg-white dark:hover:bg-gray-700 transition-all duration-300 group"
|
||||
:style="{ animationDelay: `${index * 50}ms` }"
|
||||
>
|
||||
<span class="text-xl sm:text-2xl font-bold text-transparent bg-clip-text bg-gradient-to-br from-blue-500 to-purple-500">{{ stat.stat }}</span>
|
||||
<span class="text-xs sm:text-sm text-gray-600 dark:text-gray-400">{{ stat.description }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Navigation Cards -->
|
||||
<section class="py-12 sm:py-16 lg:py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12">
|
||||
<div class="text-center mb-10 sm:mb-14">
|
||||
<h2 class="section-title">Explore the Manifesto</h2>
|
||||
<p class="section-subtitle">Deep dive into each aspect of BEAT</p>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-5 lg:gap-6">
|
||||
<PageSection title="Where to go next" summary="Sections are the reading order of the manifesto.">
|
||||
<ol class="space-y-4">
|
||||
<li v-for="section in orderedSections" :key="section.id">
|
||||
<RouterLink
|
||||
v-for="(card, index) in navCards"
|
||||
:key="card.path"
|
||||
:to="card.path"
|
||||
class="group card p-5 sm:p-6 lg:p-8"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
:to="sectionPath(section.id)"
|
||||
class="text-heading font-semibold text-accent underline underline-offset-4"
|
||||
>
|
||||
<div class="flex items-start gap-4 sm:gap-5">
|
||||
<div
|
||||
class="w-12 h-12 sm:w-14 sm:h-14 rounded-xl sm:rounded-2xl bg-gradient-to-br flex items-center justify-center flex-shrink-0 transition-all duration-300 group-hover:scale-110 group-hover:rotate-6"
|
||||
:class="card.gradient"
|
||||
>
|
||||
<i :class="card.icon" class="text-white text-lg sm:text-xl"></i>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<h3 class="font-semibold text-base sm:text-lg text-gray-900 dark:text-gray-100 mb-1 sm:mb-2 flex items-center gap-2 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">
|
||||
{{ card.title }}
|
||||
<i class="fas fa-arrow-right text-xs sm:text-sm opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300"></i>
|
||||
</h3>
|
||||
<p class="text-xs sm:text-sm text-gray-600 dark:text-gray-400 leading-relaxed">{{ card.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ section.label }}
|
||||
</RouterLink>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Commitment Section -->
|
||||
<section class="py-12 sm:py-16 lg:py-20 relative overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-blue-600 via-purple-600 to-cyan-600"></div>
|
||||
|
||||
<!-- Animated background pattern -->
|
||||
<div class="absolute inset-0 opacity-10">
|
||||
<div class="absolute top-0 left-0 w-full h-full bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImEiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgNDBoNDBWMEgwVjQwWiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik0wIDQwaDQwVjBIMFY0MFoiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMC4xIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2EpIi8+PC9zdmc+')] animate-pulse-slow"></div>
|
||||
</div>
|
||||
|
||||
<div class="relative w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12">
|
||||
<div class="text-center mb-8 sm:mb-12">
|
||||
<h2 class="text-2xl sm:text-3xl lg:text-4xl font-bold text-white mb-3 sm:mb-4">The BEAT Commitment</h2>
|
||||
<p class="text-white/70 text-base sm:text-lg">By adopting BEAT, we commit to:</p>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4 lg:gap-5">
|
||||
<div
|
||||
v-for="(item, index) in commitments"
|
||||
:key="item.title"
|
||||
class="group bg-white/10 backdrop-blur-sm p-5 sm:p-6 rounded-xl sm:rounded-2xl border border-white/10 hover:bg-white/20 transition-all duration-300 hover:-translate-y-1"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-center gap-3 sm:gap-4 mb-2 sm:mb-3">
|
||||
<div class="w-10 h-10 sm:w-12 sm:h-12 rounded-lg sm:rounded-xl bg-white/20 flex items-center justify-center transition-all duration-300 group-hover:scale-110 group-hover:bg-white/30">
|
||||
<i :class="item.icon" class="text-white text-base sm:text-xl"></i>
|
||||
</div>
|
||||
<span class="text-white font-semibold text-base sm:text-lg">{{ item.title }}</span>
|
||||
</div>
|
||||
<p class="text-white/70 text-xs sm:text-sm leading-relaxed pl-13 sm:pl-16">{{ item.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Summary -->
|
||||
<section class="py-12 sm:py-16 lg:py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 text-center">
|
||||
<div class="glass p-6 sm:p-8 lg:p-10 xl:p-14 rounded-2xl sm:rounded-3xl relative overflow-hidden">
|
||||
<!-- Decorative gradient -->
|
||||
<div class="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-blue-500 via-purple-500 to-cyan-500"></div>
|
||||
|
||||
<div class="font-mono text-base sm:text-lg lg:text-xl xl:text-2xl text-gray-700 dark:text-gray-300 space-y-2 sm:space-y-3">
|
||||
<p class="hover:text-blue-600 dark:hover:text-blue-400 transition-colors cursor-default">We protect focus.</p>
|
||||
<p class="hover:text-purple-600 dark:hover:text-purple-400 transition-colors cursor-default">We write things down.</p>
|
||||
<p class="hover:text-cyan-600 dark:hover:text-cyan-400 transition-colors cursor-default">We trust each other.</p>
|
||||
<p class="hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors cursor-default">We work sustainably.</p>
|
||||
<p class="hover:text-pink-600 dark:hover:text-pink-400 transition-colors cursor-default">We ship and learn.</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 sm:mt-8 pt-6 sm:pt-8 border-t border-gray-200 dark:border-gray-700">
|
||||
<p class="text-gray-500 dark:text-gray-500 italic text-base sm:text-lg">
|
||||
BEAT: Built for how developers actually work.
|
||||
</p>
|
||||
<p class="mt-3 sm:mt-4 text-xs sm:text-sm text-gray-400 dark:text-gray-600">
|
||||
BEAT v1.0 by Lukasz Raczylo
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<ul class="mt-1 flex flex-wrap gap-x-4 gap-y-1">
|
||||
<li v-for="page in pagesInSection(section.id)" :key="page.name">
|
||||
<RouterLink :to="page.path" class="text-body-base text-body hover:text-foreground hover:underline">
|
||||
{{ page.meta.title }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { RouterLink, useRoute } from 'vue-router'
|
||||
import { sections } from '@/router'
|
||||
import { pagesInSection } from '@/router/sections'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
// The requested path, as the reader typed it. The hash history keeps it in
|
||||
// the fragment, and the catch-all route records it in `pathMatch`.
|
||||
const requestedPath = computed(() => {
|
||||
const matched = route.params.pathMatch
|
||||
if (Array.isArray(matched) && matched.length > 0) return `/${matched.join('/')}`
|
||||
return route.fullPath
|
||||
})
|
||||
|
||||
const startPages = pagesInSection(sections.find((section) => section.id === 'start')?.id ?? 'start')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader
|
||||
title="Page not found"
|
||||
summary="The address below does not match a page on this site."
|
||||
/>
|
||||
|
||||
<p class="mt-6 text-body-lg text-large">
|
||||
<i class="fas fa-circle-question mr-2 text-muted-foreground" aria-hidden="true"></i>
|
||||
<span class="font-mono text-body-base break-all">{{ requestedPath }}</span>
|
||||
</p>
|
||||
|
||||
<p class="mt-6 text-body-base text-body">
|
||||
<RouterLink to="/" class="font-semibold text-accent underline underline-offset-4">
|
||||
Go to the home page
|
||||
</RouterLink>
|
||||
or pick a page from the navigation above.
|
||||
</p>
|
||||
|
||||
<nav aria-label="Start pages" class="mt-10 border-t border-border pt-6">
|
||||
<h2 class="text-title font-semibold text-large">Start</h2>
|
||||
<ul class="mt-2 space-y-1">
|
||||
<li v-for="page in startPages" :key="page.name">
|
||||
<RouterLink :to="page.path" class="text-body-base text-accent underline underline-offset-4">
|
||||
{{ page.meta.title }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,174 +1,25 @@
|
||||
<script setup>
|
||||
import { onboarding } from '@/data/manifesto'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
|
||||
const weeks = [
|
||||
{ ...onboarding.weekOne, icon: 'fas fa-eye', gradient: 'from-blue-500 to-cyan-500', color: 'blue' },
|
||||
{ ...onboarding.weekTwo, icon: 'fas fa-hand-pointer', gradient: 'from-purple-500 to-pink-500', color: 'purple' },
|
||||
{ ...onboarding.weekThree, icon: 'fas fa-rocket', gradient: 'from-emerald-500 to-teal-500', color: 'emerald' }
|
||||
]
|
||||
|
||||
const whatWeDont = [
|
||||
'Throw new members into complex work immediately',
|
||||
'Expect full productivity in week one',
|
||||
'Leave people to figure it out alone',
|
||||
'Assign mandatory onboarding buddies for months'
|
||||
]
|
||||
const ramp = Object.entries(onboarding)
|
||||
.filter(([key]) => key !== 'id')
|
||||
.map(([, value]) => value)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-32 sm:pt-40 pb-16 sm:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-amber-50 via-orange-50 to-red-50 dark:from-gray-900 dark:via-amber-950/20 dark:to-orange-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-96 h-96 bg-amber-400/20 dark:bg-amber-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-80 h-80 bg-orange-400/20 dark:bg-orange-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader
|
||||
eyebrow="Applying BEAT"
|
||||
title="Onboarding"
|
||||
:summary="`The ramp runs in three weeks and settles in the first month. ${ramp.length} steps below, in the order a new maker meets them.`"
|
||||
/>
|
||||
|
||||
<div class="relative max-w-6xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 text-sm font-medium mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-user-plus"></i>
|
||||
Getting Started
|
||||
</div>
|
||||
<div class="w-20 h-20 rounded-2xl bg-gradient-to-br from-amber-500 to-orange-500 flex items-center justify-center mx-auto mb-8 animate-fade-in-up animate-delay-100">
|
||||
<i class="fas fa-user-plus text-white text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">Onboarding to BEAT</h1>
|
||||
<p class="section-subtitle max-w-2xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
When someone new joins a BEAT team, here's how to get them up to speed.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Weekly Timeline -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="space-y-6">
|
||||
<div
|
||||
v-for="(week, index) in weeks"
|
||||
:key="week.title"
|
||||
class="card p-8"
|
||||
:style="{ animationDelay: `${index * 150}ms` }"
|
||||
>
|
||||
<div class="flex flex-col sm:flex-row sm:items-start gap-6">
|
||||
<div
|
||||
class="w-20 h-20 rounded-2xl bg-gradient-to-br flex items-center justify-center flex-shrink-0 shadow-lg"
|
||||
:class="week.gradient"
|
||||
>
|
||||
<i :class="week.icon" class="text-white text-2xl"></i>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h3 class="text-2xl font-bold text-gray-900 dark:text-gray-100 mb-5">{{ week.title }}</h3>
|
||||
<ul class="grid sm:grid-cols-2 gap-3">
|
||||
<li
|
||||
v-for="item in week.items"
|
||||
:key="item"
|
||||
class="flex items-start gap-3 p-3 rounded-xl bg-gray-50 dark:bg-gray-800/50"
|
||||
>
|
||||
<i class="fas fa-check-circle text-emerald-500 mt-1"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">{{ item }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- First Month -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">{{ onboarding.firstMonth.title }}</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">By the end of the first month, new members should:</p>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-5">
|
||||
<div
|
||||
v-for="(item, index) in onboarding.firstMonth.items"
|
||||
:key="item"
|
||||
class="card p-6 group"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-amber-500 to-orange-500 flex items-center justify-center flex-shrink-0 group-hover:scale-110 transition-transform">
|
||||
<span class="text-white text-lg font-bold">{{ index + 1 }}</span>
|
||||
</div>
|
||||
<p class="text-gray-700 dark:text-gray-300 pt-2">{{ item }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Connector's Responsibility & What We Don't -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="grid md:grid-cols-2 gap-8">
|
||||
<div class="card p-8">
|
||||
<div class="flex items-center gap-4 mb-6">
|
||||
<div class="w-14 h-14 rounded-xl bg-gradient-to-br from-cyan-500 to-blue-500 flex items-center justify-center">
|
||||
<i class="fas fa-project-diagram text-white text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100">Connector's Responsibility</h3>
|
||||
</div>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-6">
|
||||
The Connector (or Enabler if no Connector) ensures:
|
||||
</p>
|
||||
<ul class="space-y-3">
|
||||
<li class="flex items-start gap-3 p-3 rounded-xl bg-cyan-50 dark:bg-cyan-900/20">
|
||||
<i class="fas fa-check text-cyan-500 mt-1"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">Documentation is current and findable</span>
|
||||
</li>
|
||||
<li class="flex items-start gap-3 p-3 rounded-xl bg-cyan-50 dark:bg-cyan-900/20">
|
||||
<i class="fas fa-check text-cyan-500 mt-1"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">New member has a "buddy" for questions (informal, not mandatory pairing)</span>
|
||||
</li>
|
||||
<li class="flex items-start gap-3 p-3 rounded-xl bg-cyan-50 dark:bg-cyan-900/20">
|
||||
<i class="fas fa-check text-cyan-500 mt-1"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">First tasks are well-scoped and achievable</span>
|
||||
</li>
|
||||
<li class="flex items-start gap-3 p-3 rounded-xl bg-cyan-50 dark:bg-cyan-900/20">
|
||||
<i class="fas fa-check text-cyan-500 mt-1"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">Overwhelm is caught early</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card p-8 border-l-4 border-red-500">
|
||||
<div class="flex items-center gap-4 mb-6">
|
||||
<div class="w-14 h-14 rounded-xl bg-gradient-to-br from-red-500 to-pink-500 flex items-center justify-center">
|
||||
<i class="fas fa-times text-white text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100">What We Don't Do</h3>
|
||||
</div>
|
||||
<ul class="space-y-3">
|
||||
<li
|
||||
v-for="item in whatWeDont"
|
||||
:key="item"
|
||||
class="flex items-start gap-3 p-3 rounded-xl bg-red-50 dark:bg-red-900/20"
|
||||
>
|
||||
<i class="fas fa-times text-red-500 mt-1"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">{{ item }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Summary -->
|
||||
<section class="py-20 relative overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-amber-500 via-orange-500 to-red-500"></div>
|
||||
|
||||
<div class="relative max-w-4xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="w-20 h-20 rounded-full bg-white/20 flex items-center justify-center mx-auto mb-8">
|
||||
<i class="fas fa-bullseye text-white text-3xl"></i>
|
||||
</div>
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-white mb-6">The Goal</h2>
|
||||
<p class="text-white/90 text-xl leading-relaxed">
|
||||
Onboarding should feel like a gradual ramp, not a firehose or an abandonment.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<PageSection v-for="step in ramp" :key="step.title" :title="step.title">
|
||||
<ul class="list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in step.items" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,395 +1,101 @@
|
||||
<script setup>
|
||||
import { ceremonies, incidentProtocol, technicalPractices, definitionOfDone } from '@/data/manifesto'
|
||||
import {
|
||||
ceremonies,
|
||||
crossTeamDependencies,
|
||||
customerFeedback,
|
||||
definitionOfDone,
|
||||
incidentProtocol,
|
||||
measurement,
|
||||
onCall,
|
||||
practicePolicy,
|
||||
technicalPractices,
|
||||
timeZones
|
||||
} from '@/data/manifesto'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
import TableCard from '@/components/ui/TableCard.vue'
|
||||
|
||||
const meetingLimits = [
|
||||
{ value: '2 hours', label: 'per week total', icon: 'fas fa-clock', color: 'blue' },
|
||||
{ value: '1 hour', label: 'maximum per meeting', icon: 'fas fa-hourglass-half', color: 'purple' },
|
||||
{ value: 'Agenda', label: 'required or cancelled', icon: 'fas fa-list-check', color: 'emerald' }
|
||||
]
|
||||
const ceremonyRows = ceremonies.map((ceremony) => [ceremony.name, ceremony.duration, ceremony.purpose])
|
||||
|
||||
const collaborationSteps = [
|
||||
{ text: 'Post when stuck', icon: 'fas fa-comment-dots' },
|
||||
{ text: 'Someone responds when available', icon: 'fas fa-reply' },
|
||||
{ text: 'Sync briefly if needed', icon: 'fas fa-video' },
|
||||
{ text: 'Return to solo work', icon: 'fas fa-user' }
|
||||
]
|
||||
|
||||
const multiMakerPrinciples = [
|
||||
{ title: 'Break vertically.', desc: 'Each maker owns an end-to-end slice.', icon: 'fas fa-arrows-alt-v' },
|
||||
{ title: 'Define interfaces first.', desc: 'Work in parallel against contracts.', icon: 'fas fa-plug' },
|
||||
{ title: 'Coordinate via doc.', desc: 'One feature doc as source of truth.', icon: 'fas fa-file-alt' },
|
||||
{ title: 'Sync only when stuck.', desc: 'Document outcome. Return to async.', icon: 'fas fa-sync' }
|
||||
]
|
||||
const situations = [onCall, timeZones, crossTeamDependencies, measurement, customerFeedback]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-32 sm:pt-40 pb-16 sm:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-emerald-50 via-teal-50 to-cyan-50 dark:from-gray-900 dark:via-emerald-950/20 dark:to-teal-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-96 h-96 bg-emerald-400/20 dark:bg-emerald-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-80 h-80 bg-teal-400/20 dark:bg-teal-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader
|
||||
eyebrow="The Method"
|
||||
title="Practices"
|
||||
summary="Meetings, incidents, the definition of done, the optional technical practices, and the situations the method covers."
|
||||
/>
|
||||
|
||||
<div class="relative max-w-6xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300 text-sm font-medium mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-cogs"></i>
|
||||
Day-to-Day
|
||||
</div>
|
||||
<div class="w-20 h-20 rounded-2xl bg-gradient-to-br from-emerald-500 to-teal-500 flex items-center justify-center mx-auto mb-8 animate-fade-in-up animate-delay-100">
|
||||
<i class="fas fa-cogs text-white text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">Practices</h1>
|
||||
<p class="section-subtitle max-w-2xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
How we work day-to-day: meetings, collaboration, incidents, and technical practices.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<PageSection title="Meetings" summary="The meeting budget applies to every scheduled meeting inside a working week.">
|
||||
<TableCard :headers="['Ceremony', 'Duration', 'Purpose']" :rows="ceremonyRows" />
|
||||
</PageSection>
|
||||
|
||||
<!-- Meetings -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Meetings</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Hard limits protect our time.</p>
|
||||
</div>
|
||||
<PageSection title="Incident protocol" summary="An incident suspends the meeting budget and the sacred block until it is stable.">
|
||||
<ol class="space-y-4">
|
||||
<li v-for="step in incidentProtocol" :key="step.step">
|
||||
<h3 class="text-title font-semibold text-large">{{ step.step }}</h3>
|
||||
<p class="max-w-prose text-body-base text-body">{{ step.description }}</p>
|
||||
</li>
|
||||
</ol>
|
||||
</PageSection>
|
||||
|
||||
<div class="glass p-8 sm:p-10 rounded-3xl mb-10">
|
||||
<div class="grid sm:grid-cols-3 gap-8">
|
||||
<div
|
||||
v-for="(item, index) in meetingLimits"
|
||||
:key="item.label"
|
||||
class="text-center group"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div
|
||||
class="w-16 h-16 rounded-2xl flex items-center justify-center mx-auto mb-4 transition-all duration-300 group-hover:scale-110"
|
||||
:class="[
|
||||
item.color === 'blue' ? 'bg-blue-100 dark:bg-blue-900/30' :
|
||||
item.color === 'purple' ? 'bg-purple-100 dark:bg-purple-900/30' :
|
||||
'bg-emerald-100 dark:bg-emerald-900/30'
|
||||
]"
|
||||
>
|
||||
<i :class="[item.icon, 'text-2xl', item.color === 'blue' ? 'text-blue-500' : item.color === 'purple' ? 'text-purple-500' : 'text-emerald-500']"></i>
|
||||
</div>
|
||||
<div class="text-3xl sm:text-4xl font-bold gradient-text mb-2">{{ item.value }}</div>
|
||||
<div class="text-gray-600 dark:text-gray-400 text-sm">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<PageSection title="Definition of done" summary="The team owns the definition and records any change to it.">
|
||||
<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">Code work</h3>
|
||||
<ul class="mt-2 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in definitionOfDone.code" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-5">
|
||||
<div
|
||||
v-for="(ceremony, index) in ceremonies"
|
||||
:key="ceremony.name"
|
||||
class="card p-6"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<h3 class="font-semibold text-lg text-gray-900 dark:text-gray-100 mb-2">{{ ceremony.name }}</h3>
|
||||
<div class="inline-block px-3 py-1 rounded-full bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 text-sm font-medium mb-3">
|
||||
{{ ceremony.duration }}
|
||||
</div>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">{{ ceremony.purpose }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 p-5 rounded-xl bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800">
|
||||
<p class="text-sm text-amber-800 dark:text-amber-200 flex items-start gap-3">
|
||||
<i class="fas fa-lightbulb mt-0.5"></i>
|
||||
<span>If a topic needs more than one hour: write first, comment async, meet on the delta. <strong>Never extend.</strong></span>
|
||||
</p>
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">Non-code work</h3>
|
||||
<ul class="mt-2 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in definitionOfDone.nonCode" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</PageSection>
|
||||
|
||||
<!-- Daily Check-in -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300 relative overflow-hidden">
|
||||
<div class="absolute bottom-0 left-0 w-96 h-96 bg-blue-500/5 dark:bg-blue-500/10 rounded-full filter blur-3xl"></div>
|
||||
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6 relative">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Daily Check-in</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Replace standups with written updates.</p>
|
||||
<PageSection title="Technical practices" :summary="practicePolicy.partialAdoption">
|
||||
<dl class="space-y-4">
|
||||
<div v-for="practice in technicalPractices" :key="practice.name">
|
||||
<dt class="text-title font-semibold text-large">{{ practice.name }}</dt>
|
||||
<dd class="max-w-prose text-body-base text-body">{{ practice.description }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p class="mt-4 max-w-prose text-body-base text-muted-foreground">
|
||||
{{ practicePolicy.scope }} {{ practicePolicy.decidedBy }}
|
||||
</p>
|
||||
</PageSection>
|
||||
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<!-- Visual Check-in Template -->
|
||||
<div class="glass p-8 rounded-3xl mb-8">
|
||||
<div class="space-y-4">
|
||||
<div class="flex items-center gap-4 p-4 rounded-xl bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-tasks text-white"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-blue-600 dark:text-blue-400 font-semibold uppercase tracking-wide">Working on</div>
|
||||
<div class="text-gray-700 dark:text-gray-300">[current task]</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4 p-4 rounded-xl bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-amber-500 to-amber-600 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-hand-paper text-white"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-amber-600 dark:text-amber-400 font-semibold uppercase tracking-wide">Blocked by</div>
|
||||
<div class="text-gray-700 dark:text-gray-300">[nothing / specific issue]</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div class="card p-5 text-center group">
|
||||
<i class="fas fa-clock text-blue-500 text-2xl mb-3 group-hover:scale-110 transition-transform block"></i>
|
||||
<div class="text-sm text-gray-600 dark:text-gray-400 font-medium">Post once daily</div>
|
||||
</div>
|
||||
<div class="card p-5 text-center group">
|
||||
<i class="fas fa-stopwatch text-purple-500 text-2xl mb-3 group-hover:scale-110 transition-transform block"></i>
|
||||
<div class="text-sm text-gray-600 dark:text-gray-400 font-medium">Two minutes</div>
|
||||
</div>
|
||||
<div class="card p-5 text-center group">
|
||||
<i class="fas fa-users-slash text-emerald-500 text-2xl mb-3 group-hover:scale-110 transition-transform block"></i>
|
||||
<div class="text-sm text-gray-600 dark:text-gray-400 font-medium">No gathering</div>
|
||||
</div>
|
||||
</div>
|
||||
<PageSection
|
||||
v-for="situation in situations"
|
||||
:key="situation.id"
|
||||
:title="situation.title"
|
||||
:summary="situation.summary"
|
||||
>
|
||||
<dl class="space-y-1 text-body-base text-body">
|
||||
<div>
|
||||
<dt class="font-semibold text-muted-foreground">Applies to</dt>
|
||||
<dd>{{ situation.appliesTo }}</dd>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Collaboration -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Collaboration</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Default mode is solo deep work.</p>
|
||||
<div>
|
||||
<dt class="font-semibold text-muted-foreground">Decided by</dt>
|
||||
<dd>{{ situation.decidedBy }}</dd>
|
||||
</div>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-8">
|
||||
<!-- Ad-hoc Help -->
|
||||
<div class="card p-8">
|
||||
<div class="flex items-center gap-4 mb-6">
|
||||
<div class="w-14 h-14 rounded-xl bg-gradient-to-br from-blue-500 to-cyan-500 flex items-center justify-center">
|
||||
<i class="fas fa-hand-holding-heart text-white text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100">Ad-hoc Help</h3>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<div
|
||||
v-for="(step, index) in collaborationSteps"
|
||||
:key="step.text"
|
||||
class="flex items-center gap-4 p-4 rounded-xl bg-gray-50 dark:bg-gray-800/50 hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-colors"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="w-10 h-10 rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 flex items-center justify-center flex-shrink-0 font-bold">
|
||||
{{ index + 1 }}
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<i :class="step.icon" class="text-blue-500"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">{{ step.text }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Multi-Maker Work -->
|
||||
<div class="card p-8">
|
||||
<div class="flex items-center gap-4 mb-6">
|
||||
<div class="w-14 h-14 rounded-xl bg-gradient-to-br from-purple-500 to-pink-500 flex items-center justify-center">
|
||||
<i class="fas fa-users text-white text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100">Multi-Maker Work</h3>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<div
|
||||
v-for="(principle, index) in multiMakerPrinciples"
|
||||
:key="principle.title"
|
||||
class="flex items-start gap-4 p-4 rounded-xl bg-gray-50 dark:bg-gray-800/50 hover:bg-purple-50 dark:hover:bg-purple-900/20 transition-colors"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="w-10 h-10 rounded-full bg-emerald-100 dark:bg-emerald-900/30 flex items-center justify-center flex-shrink-0">
|
||||
<i :class="principle.icon" class="text-emerald-500"></i>
|
||||
</div>
|
||||
<div>
|
||||
<span class="font-semibold text-gray-900 dark:text-gray-100 block">{{ principle.title }}</span>
|
||||
<span class="text-sm text-gray-600 dark:text-gray-400">{{ principle.desc }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="font-semibold text-muted-foreground">If it does not fit</dt>
|
||||
<dd>{{ situation.ifItDoesNotFit }}</dd>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 p-5 rounded-xl bg-gray-100 dark:bg-gray-800">
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 text-center">
|
||||
We do not schedule pairing. We do not mandate walkthroughs. We do not assign buddies. Collaboration is initiated by those who need it.
|
||||
</p>
|
||||
</dl>
|
||||
<dl class="mt-4 space-y-3">
|
||||
<div v-for="item in situation.items" :key="item.title">
|
||||
<dt class="text-title font-semibold text-large">{{ item.title }}</dt>
|
||||
<dd class="max-w-prose text-body-base text-body">{{ item.detail }}</dd>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Definition of Done -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Definition of Done</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Work is not done until it meets these criteria.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-8">
|
||||
<div class="card p-8">
|
||||
<div class="flex items-center gap-4 mb-6">
|
||||
<div class="w-14 h-14 rounded-xl bg-gradient-to-br from-blue-500 to-cyan-500 flex items-center justify-center">
|
||||
<i class="fas fa-code text-white text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100">For Code</h3>
|
||||
</div>
|
||||
<ul class="space-y-3">
|
||||
<li
|
||||
v-for="item in definitionOfDone.code"
|
||||
:key="item"
|
||||
class="flex items-center gap-3 p-3 rounded-xl bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800"
|
||||
>
|
||||
<div class="w-8 h-8 rounded-full bg-emerald-500 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-check text-white text-sm"></i>
|
||||
</div>
|
||||
<span class="text-gray-700 dark:text-gray-300">{{ item }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card p-8">
|
||||
<div class="flex items-center gap-4 mb-6">
|
||||
<div class="w-14 h-14 rounded-xl bg-gradient-to-br from-purple-500 to-pink-500 flex items-center justify-center">
|
||||
<i class="fas fa-file-alt text-white text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100">For Non-Code</h3>
|
||||
</div>
|
||||
<ul class="space-y-3">
|
||||
<li
|
||||
v-for="item in definitionOfDone.nonCode"
|
||||
:key="item"
|
||||
class="flex items-center gap-3 p-3 rounded-xl bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800"
|
||||
>
|
||||
<div class="w-8 h-8 rounded-full bg-purple-500 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-check text-white text-sm"></i>
|
||||
</div>
|
||||
<span class="text-gray-700 dark:text-gray-300">{{ item }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 p-5 rounded-xl bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800">
|
||||
<p class="text-sm text-blue-800 dark:text-blue-200 flex items-start gap-3">
|
||||
<i class="fas fa-info-circle mt-0.5"></i>
|
||||
<span>The team owns this definition. Adjust it as needed. But once agreed, honor it. "Done" means done—not "done but..." or "done except..."</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Incidents -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Incidents & Emergencies</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">When production breaks, normal rules suspend temporarily.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-8 mb-8">
|
||||
<div class="card p-8 border-l-4 border-red-500">
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100 mb-6 flex items-center gap-3">
|
||||
<i class="fas fa-exclamation-triangle text-red-500"></i>
|
||||
What Qualifies
|
||||
</h3>
|
||||
<ul class="space-y-4">
|
||||
<li class="flex items-center gap-3 p-3 rounded-xl bg-red-50 dark:bg-red-900/20">
|
||||
<i class="fas fa-times-circle text-red-500"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">Users cannot complete critical actions</span>
|
||||
</li>
|
||||
<li class="flex items-center gap-3 p-3 rounded-xl bg-red-50 dark:bg-red-900/20">
|
||||
<i class="fas fa-times-circle text-red-500"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">Data integrity is at risk</span>
|
||||
</li>
|
||||
<li class="flex items-center gap-3 p-3 rounded-xl bg-red-50 dark:bg-red-900/20">
|
||||
<i class="fas fa-times-circle text-red-500"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">Security vulnerability being exploited</span>
|
||||
</li>
|
||||
<li class="flex items-center gap-3 p-3 rounded-xl bg-red-50 dark:bg-red-900/20">
|
||||
<i class="fas fa-times-circle text-red-500"></i>
|
||||
<span class="text-gray-700 dark:text-gray-300">Significant revenue or reputation impact</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card p-8">
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-gray-100 mb-6 flex items-center gap-3">
|
||||
<i class="fas fa-clipboard-list text-blue-500"></i>
|
||||
Incident Protocol
|
||||
</h3>
|
||||
<div class="relative">
|
||||
<!-- Flow line -->
|
||||
<div class="absolute left-5 top-8 bottom-8 w-0.5 bg-gradient-to-b from-red-500 via-orange-500 to-green-500 hidden sm:block"></div>
|
||||
<div class="space-y-4">
|
||||
<div
|
||||
v-for="(step, index) in incidentProtocol"
|
||||
:key="step.step"
|
||||
class="flex items-start gap-4"
|
||||
>
|
||||
<div
|
||||
class="w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 z-10 text-sm font-bold"
|
||||
:class="[
|
||||
index === 0 ? 'bg-red-500 text-white' :
|
||||
index === 1 ? 'bg-orange-500 text-white' :
|
||||
index === 2 ? 'bg-amber-500 text-white' :
|
||||
index === 3 ? 'bg-blue-500 text-white' :
|
||||
'bg-green-500 text-white'
|
||||
]"
|
||||
>
|
||||
{{ index + 1 }}
|
||||
</div>
|
||||
<div class="flex-1 pb-2">
|
||||
<div class="font-semibold text-gray-900 dark:text-gray-100">{{ step.step.replace(/^\d+\.\s*/, '') }}</div>
|
||||
<div class="text-sm text-gray-600 dark:text-gray-400">{{ step.description }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 rounded-xl bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800">
|
||||
<p class="text-sm text-amber-800 dark:text-amber-200 flex items-start gap-3">
|
||||
<i class="fas fa-lightbulb mt-0.5"></i>
|
||||
<span>This is not normal work. Incidents should be rare. If they're frequent, that's a systemic problem to solve—not a reason to abandon sustainable pace.</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Technical Practices -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Technical Practices</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">Optional practices that align well with BEAT principles.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-5">
|
||||
<div
|
||||
v-for="(practice, index) in technicalPractices"
|
||||
:key="practice.name"
|
||||
class="card p-6 group"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<h3 class="font-semibold text-lg text-gray-900 dark:text-gray-100 mb-3 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">
|
||||
{{ practice.name }}
|
||||
</h3>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 leading-relaxed">{{ practice.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="mt-10 text-center text-gray-500 dark:text-gray-500">
|
||||
These are not mandated. They are offered as practices that support focus, speed, and quality. <strong class="text-gray-700 dark:text-gray-300">Adopt what serves you. Discard what doesn't.</strong>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</dl>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,119 +1,34 @@
|
||||
<script setup>
|
||||
import { principles } from '@/data/manifesto'
|
||||
import { principles, principleSections } from '@/data/manifesto'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
|
||||
const categories = [
|
||||
{ key: 'focus', title: 'On Focus', icon: 'fas fa-bullseye', gradient: 'from-blue-500 to-cyan-500', color: 'blue', desc: 'Protecting the deep work state' },
|
||||
{ key: 'communication', title: 'On Communication', icon: 'fas fa-comments', gradient: 'from-purple-500 to-pink-500', color: 'purple', desc: 'Writing first, meeting wisely' },
|
||||
{ key: 'autonomy', title: 'On Autonomy', icon: 'fas fa-user-shield', gradient: 'from-emerald-500 to-teal-500', color: 'emerald', desc: 'Trusting makers to make' },
|
||||
{ key: 'sustainability', title: 'On Sustainability', icon: 'fas fa-leaf', gradient: 'from-amber-500 to-orange-500', color: 'amber', desc: 'Pace that lasts' }
|
||||
]
|
||||
const principleCount = Object.values(principles).reduce((total, group) => total + group.length, 0)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-28 sm:pt-32 lg:pt-40 pb-12 sm:pb-16 lg:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-blue-50 via-purple-50 to-green-50 dark:from-gray-900 dark:via-blue-950/20 dark:to-purple-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-72 h-72 sm:w-96 sm:h-96 bg-blue-400/20 dark:bg-blue-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-64 h-64 sm:w-80 sm:h-80 bg-purple-400/20 dark:bg-purple-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader
|
||||
eyebrow="Foundations"
|
||||
title="Principles"
|
||||
:summary="`${principleCount} principles in ${principleSections.length} groups. Each principle states the rule and the exception it allows.`"
|
||||
/>
|
||||
|
||||
<div class="relative w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-3 sm:px-4 py-1.5 sm:py-2 rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 text-xs sm:text-sm font-medium mb-4 sm:mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-compass"></i>
|
||||
Guiding Principles
|
||||
</div>
|
||||
<div class="w-16 h-16 sm:w-20 sm:h-20 rounded-xl sm:rounded-2xl bg-gradient-to-br from-blue-500 to-cyan-500 flex items-center justify-center mx-auto mb-6 sm:mb-8 animate-fade-in-up animate-delay-100 shadow-glow-blue">
|
||||
<i class="fas fa-compass text-white text-2xl sm:text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">The Twelve Principles</h1>
|
||||
<p class="section-subtitle max-w-2xl lg:max-w-3xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
Guiding principles organized into four categories: Focus, Communication, Autonomy, and Sustainability.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Principles by Category -->
|
||||
<section
|
||||
v-for="(category, catIndex) in categories"
|
||||
:key="category.key"
|
||||
class="py-12 sm:py-16 lg:py-20 transition-colors duration-300 relative"
|
||||
:class="catIndex % 2 === 0 ? 'bg-white dark:bg-gray-900' : 'bg-gray-50 dark:bg-gray-800/30'"
|
||||
<PageSection
|
||||
v-for="group in principleSections"
|
||||
:key="group.id"
|
||||
:title="group.title"
|
||||
:summary="`Principles ${group.number}`"
|
||||
>
|
||||
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12">
|
||||
<div class="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 mb-6 sm:mb-10">
|
||||
<div
|
||||
class="w-12 h-12 sm:w-14 sm:h-14 lg:w-16 lg:h-16 rounded-xl sm:rounded-2xl bg-gradient-to-br flex items-center justify-center flex-shrink-0 shadow-lg"
|
||||
:class="category.gradient"
|
||||
>
|
||||
<i :class="category.icon" class="text-white text-xl sm:text-2xl"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-xl sm:text-2xl lg:text-3xl font-bold text-gray-900 dark:text-gray-100">{{ category.title }}</h2>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-sm sm:text-base">{{ category.desc }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4 sm:space-y-5">
|
||||
<div
|
||||
v-for="(principle, index) in principles[category.key]"
|
||||
:key="principle.number"
|
||||
class="card group p-5 sm:p-6 lg:p-8"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-start gap-3 sm:gap-5">
|
||||
<div
|
||||
class="w-9 h-9 sm:w-10 sm:h-10 lg:w-12 lg:h-12 rounded-lg sm:rounded-xl bg-gradient-to-br flex items-center justify-center flex-shrink-0 shadow-md group-hover:scale-110 transition-all duration-300"
|
||||
:class="category.gradient"
|
||||
>
|
||||
<span class="text-white font-bold text-sm sm:text-base lg:text-lg">{{ principle.number }}</span>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<h3 class="text-lg sm:text-xl lg:text-2xl font-bold text-gray-900 dark:text-gray-100 mb-2 sm:mb-3 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">
|
||||
{{ principle.title }}
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 leading-relaxed text-sm sm:text-base">
|
||||
{{ principle.description }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Summary -->
|
||||
<section class="py-12 sm:py-16 lg:py-20 relative overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-blue-600 via-purple-600 to-emerald-600"></div>
|
||||
|
||||
<!-- Animated pattern -->
|
||||
<div class="absolute inset-0 opacity-10">
|
||||
<div class="absolute top-0 left-0 w-full h-full bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9InAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgNDBoNDBWMEgwVjQwWiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik0wIDQwaDQwVjBIMFY0MFoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4xIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI3ApIi8+PC9zdmc+')] animate-pulse-slow"></div>
|
||||
</div>
|
||||
|
||||
<div class="relative w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12">
|
||||
<h2 class="text-2xl sm:text-3xl lg:text-4xl font-bold text-white text-center mb-8 sm:mb-10">Principles in Summary</h2>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-5">
|
||||
<div
|
||||
v-for="(category, index) in categories"
|
||||
:key="category.key"
|
||||
class="bg-white/10 backdrop-blur-sm p-5 sm:p-6 rounded-xl sm:rounded-2xl border border-white/10 hover:bg-white/20 transition-all duration-300"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-center gap-3 mb-3 sm:mb-4">
|
||||
<div class="w-9 h-9 sm:w-10 sm:h-10 rounded-lg sm:rounded-xl bg-white/20 flex items-center justify-center">
|
||||
<i :class="category.icon" class="text-white"></i>
|
||||
</div>
|
||||
<span class="text-white font-semibold text-base sm:text-lg">{{ category.title }}</span>
|
||||
</div>
|
||||
<ul class="text-white/80 text-xs sm:text-sm space-y-1.5 sm:space-y-2">
|
||||
<li v-for="p in principles[category.key]" :key="p.number" class="flex items-center gap-2">
|
||||
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-xs flex-shrink-0">{{ p.number }}</span>
|
||||
<span class="truncate">{{ p.title.split('.')[0] }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<ol class="space-y-6">
|
||||
<li v-for="principle in principles[group.key]" :key="principle.number">
|
||||
<h3 class="text-title font-semibold text-large">
|
||||
<span class="text-muted-foreground">{{ principle.number }}.</span>
|
||||
{{ principle.title }}
|
||||
</h3>
|
||||
<p class="mt-1 max-w-prose text-body-base text-body">{{ principle.description }}</p>
|
||||
</li>
|
||||
</ol>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,312 +1,95 @@
|
||||
<script setup>
|
||||
import {
|
||||
ceremonies,
|
||||
constraints,
|
||||
coreValues,
|
||||
definitionOfDone,
|
||||
incidentProtocol,
|
||||
priorityBuckets,
|
||||
roles
|
||||
} from '@/data/manifesto'
|
||||
import { references } from '@/data/references'
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
import TableCard from '@/components/ui/TableCard.vue'
|
||||
import CopyButton from '@/components/ui/CopyButton.vue'
|
||||
import { coreValues, teamValues, constraints, priorityBuckets, roles, ceremonies, definitionOfDone, incidentProtocol } from '@/data/manifesto'
|
||||
|
||||
const coreValuesHeaders = ['We Value More', 'Over']
|
||||
const coreValuesRows = coreValues.map(v => [
|
||||
`<strong>${v.valueMore}</strong>`,
|
||||
v.over
|
||||
])
|
||||
|
||||
const teamValuesHeaders = ['Value', 'Meaning']
|
||||
const teamValuesRows = teamValues.map(v => [
|
||||
`<strong>${v.name}</strong>`,
|
||||
v.description.split('.')[0] + '.'
|
||||
])
|
||||
|
||||
const constraintsHeaders = ['Constraint', 'Limit']
|
||||
const constraintsRows = constraints.map(c => [
|
||||
c.constraint,
|
||||
`<strong class="text-blue-600 dark:text-blue-400">${c.limit}</strong>`
|
||||
])
|
||||
|
||||
const bucketsHeaders = ['Bucket', 'Meaning']
|
||||
const bucketsRows = priorityBuckets.map(b => [
|
||||
`<strong>${b.name}</strong>`,
|
||||
b.description.split('.')[0]
|
||||
])
|
||||
|
||||
const rolesHeaders = ['Role', 'Purpose']
|
||||
const rolesRows = roles.map(r => [
|
||||
`<strong>${r.name.replace('The ', '')}</strong>`,
|
||||
r.description.split('.')[0]
|
||||
])
|
||||
|
||||
const ceremoniesHeaders = ['Event', 'Duration', 'Purpose']
|
||||
const ceremoniesRows = ceremonies.map(c => [
|
||||
`<strong>${c.name}</strong>`,
|
||||
c.duration,
|
||||
c.purpose
|
||||
])
|
||||
|
||||
const spottedIssueFlow = [
|
||||
{ question: 'Blocking your work?', answer: 'Fix now', icon: 'fas fa-ban', color: 'red' },
|
||||
{ question: '5 minutes or less?', answer: 'Fix now', icon: 'fas fa-clock', color: 'amber' },
|
||||
{ question: 'More than 5 minutes?', answer: 'Log it, continue', icon: 'fas fa-sticky-note', color: 'blue' },
|
||||
{ question: 'Production critical?', answer: 'Flag team', icon: 'fas fa-exclamation-triangle', color: 'purple' }
|
||||
]
|
||||
|
||||
const colorMap = {
|
||||
red: { bg: 'from-red-500 to-red-600', border: 'border-red-200 dark:border-red-800', text: 'text-red-700 dark:text-red-300', badge: 'bg-red-50 dark:bg-red-900/20' },
|
||||
amber: { bg: 'from-amber-500 to-amber-600', border: 'border-amber-200 dark:border-amber-800', text: 'text-amber-700 dark:text-amber-300', badge: 'bg-amber-50 dark:bg-amber-900/20' },
|
||||
blue: { bg: 'from-blue-500 to-blue-600', border: 'border-blue-200 dark:border-blue-800', text: 'text-blue-700 dark:text-blue-300', badge: 'bg-blue-50 dark:bg-blue-900/20' },
|
||||
purple: { bg: 'from-purple-500 to-purple-600', border: 'border-purple-200 dark:border-purple-800', text: 'text-purple-700 dark:text-purple-300', badge: 'bg-purple-50 dark:bg-purple-900/20' }
|
||||
}
|
||||
|
||||
const incidentColors = [
|
||||
'from-red-500 to-red-600',
|
||||
'from-orange-500 to-orange-600',
|
||||
'from-amber-500 to-amber-600',
|
||||
'from-blue-500 to-blue-600',
|
||||
'from-green-500 to-green-600'
|
||||
]
|
||||
|
||||
// Template text for copying
|
||||
const dailyCheckinTemplate = `Working on: [current task]
|
||||
Blocked by: [nothing / specific issue]`
|
||||
|
||||
const definitionOfDoneText = definitionOfDone.code.join('\n')
|
||||
const valueRows = coreValues.map((value) => [value.valueMore, value.over])
|
||||
const constraintRows = constraints.map((item) => [item.constraint, item.limit])
|
||||
const bucketRows = priorityBuckets.map((bucket) => [bucket.name, bucket.description])
|
||||
const roleRows = roles.map((role) => [role.name, role.description])
|
||||
const ceremonyRows = ceremonies.map((ceremony) => [ceremony.name, ceremony.duration, ceremony.purpose])
|
||||
const incidentRows = incidentProtocol.map((step) => [step.step, step.description])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-32 sm:pt-40 pb-16 sm:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-cyan-50 via-blue-50 to-indigo-50 dark:from-gray-900 dark:via-cyan-950/20 dark:to-blue-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-96 h-96 bg-cyan-400/20 dark:bg-cyan-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-80 h-80 bg-blue-400/20 dark:bg-blue-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader
|
||||
eyebrow="Reference"
|
||||
title="Quick Reference"
|
||||
summary="The numbers, roles and templates of the method in one place, with the sources of every figure."
|
||||
/>
|
||||
|
||||
<div class="relative max-w-6xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-cyan-100 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-300 text-sm font-medium mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-book"></i>
|
||||
Quick Lookup
|
||||
</div>
|
||||
<div class="w-20 h-20 rounded-2xl bg-gradient-to-br from-cyan-500 to-blue-500 flex items-center justify-center mx-auto mb-8 animate-fade-in-up animate-delay-100">
|
||||
<i class="fas fa-book text-white text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">Quick Reference</h1>
|
||||
<p class="section-subtitle max-w-2xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
Everything you need at a glance. Copy templates with one click.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<PageSection title="Core values">
|
||||
<TableCard :headers="['We value more', 'Over']" :rows="valueRows" />
|
||||
</PageSection>
|
||||
|
||||
<!-- Core Values -->
|
||||
<section class="py-10 sm:py-14 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-rose-500 to-pink-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Core Values</h2>
|
||||
</div>
|
||||
<TableCard :headers="coreValuesHeaders" :rows="coreValuesRows" />
|
||||
</div>
|
||||
</section>
|
||||
<PageSection title="Constraints" summary="Every limit is a BEAT default, not a research finding.">
|
||||
<TableCard :headers="['Constraint', 'Limit']" :rows="constraintRows" />
|
||||
</PageSection>
|
||||
|
||||
<!-- Team Values -->
|
||||
<section class="py-10 sm:py-14 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-blue-500 to-purple-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Team Values</h2>
|
||||
</div>
|
||||
<TableCard :headers="teamValuesHeaders" :rows="teamValuesRows" />
|
||||
</div>
|
||||
</section>
|
||||
<PageSection title="Priority buckets">
|
||||
<TableCard :headers="['Bucket', 'What it holds']" :rows="bucketRows" />
|
||||
</PageSection>
|
||||
|
||||
<!-- The Numbers -->
|
||||
<section class="py-10 sm:py-14 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-purple-500 to-indigo-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">The Numbers</h2>
|
||||
</div>
|
||||
<TableCard :headers="constraintsHeaders" :rows="constraintsRows" />
|
||||
</div>
|
||||
</section>
|
||||
<PageSection title="Roles">
|
||||
<TableCard :headers="['Role', 'What the role does']" :rows="roleRows" />
|
||||
</PageSection>
|
||||
|
||||
<!-- Buckets & Roles -->
|
||||
<section class="py-10 sm:py-14 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="grid md:grid-cols-2 gap-8">
|
||||
<div>
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-amber-500 to-orange-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Priority Buckets</h2>
|
||||
</div>
|
||||
<TableCard :headers="bucketsHeaders" :rows="bucketsRows" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-emerald-500 to-teal-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Roles</h2>
|
||||
</div>
|
||||
<TableCard :headers="rolesHeaders" :rows="rolesRows" />
|
||||
</div>
|
||||
<PageSection title="Ceremonies">
|
||||
<TableCard :headers="['Ceremony', 'Duration', 'Purpose']" :rows="ceremonyRows" />
|
||||
</PageSection>
|
||||
|
||||
<PageSection title="Definition of done">
|
||||
<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">Code work</h3>
|
||||
<ul class="mt-2 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in definitionOfDone.code" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-title font-semibold text-large">Non-code work</h3>
|
||||
<ul class="mt-2 list-disc space-y-1 pl-5 text-body-base text-body">
|
||||
<li v-for="item in definitionOfDone.nonCode" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</PageSection>
|
||||
|
||||
<!-- Ceremonies -->
|
||||
<section class="py-10 sm:py-14 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-cyan-500 to-blue-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Ceremonies</h2>
|
||||
</div>
|
||||
<TableCard :headers="ceremoniesHeaders" :rows="ceremoniesRows" />
|
||||
</div>
|
||||
</section>
|
||||
<PageSection title="Incident protocol">
|
||||
<TableCard :headers="['Step', 'What happens']" :rows="incidentRows" />
|
||||
</PageSection>
|
||||
|
||||
<!-- Templates with Copy Buttons -->
|
||||
<section class="py-10 sm:py-14 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-3 mb-8">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-pink-500 to-rose-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Templates</h2>
|
||||
<span class="px-2 py-1 rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 text-xs font-medium">Click to copy</span>
|
||||
</div>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-6">
|
||||
<!-- Daily Check-in Card -->
|
||||
<div class="card p-6">
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-3">
|
||||
<div class="w-10 h-10 rounded-xl bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center">
|
||||
<i class="fas fa-calendar-check text-blue-500"></i>
|
||||
</div>
|
||||
Daily Check-in
|
||||
</h3>
|
||||
<CopyButton :text="dailyCheckinTemplate" label="Copy" />
|
||||
</div>
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center gap-4 p-4 rounded-xl bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-tasks text-white"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-blue-600 dark:text-blue-400 font-semibold uppercase tracking-wide">Working on</div>
|
||||
<div class="text-gray-700 dark:text-gray-300">[current task]</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4 p-4 rounded-xl bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-amber-500 to-amber-600 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-hand-paper text-white"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-amber-600 dark:text-amber-400 font-semibold uppercase tracking-wide">Blocked by</div>
|
||||
<div class="text-gray-700 dark:text-gray-300">[nothing / specific issue]</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Spotted Issue Decision Flow -->
|
||||
<div class="card p-6">
|
||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-5 flex items-center gap-3">
|
||||
<div class="w-10 h-10 rounded-xl bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center">
|
||||
<i class="fas fa-code-branch text-purple-500"></i>
|
||||
</div>
|
||||
Spotted Issue Decision
|
||||
</h3>
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
v-for="(item, index) in spottedIssueFlow"
|
||||
:key="index"
|
||||
class="flex items-center gap-3 p-3 rounded-xl border"
|
||||
:class="[colorMap[item.color].badge, colorMap[item.color].border]"
|
||||
>
|
||||
<div
|
||||
class="w-10 h-10 rounded-xl bg-gradient-to-br flex items-center justify-center flex-shrink-0"
|
||||
:class="colorMap[item.color].bg"
|
||||
>
|
||||
<i :class="item.icon" class="text-white"></i>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">{{ item.question }}</span>
|
||||
</div>
|
||||
<i class="fas fa-arrow-right text-xs opacity-50"></i>
|
||||
<span class="text-sm font-bold whitespace-nowrap" :class="colorMap[item.color].text">{{ item.answer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Definition of Done -->
|
||||
<section class="py-10 sm:py-14 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-emerald-500 to-green-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Definition of Done (Code)</h2>
|
||||
</div>
|
||||
<CopyButton :text="definitionOfDoneText" label="Copy All" />
|
||||
</div>
|
||||
<div class="card p-6">
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-3">
|
||||
<div
|
||||
v-for="item in definitionOfDone.code"
|
||||
:key="item"
|
||||
class="flex items-center gap-3 p-4 rounded-xl bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800"
|
||||
<PageSection title="References" summary="Each inline citation id in the prose resolves to one entry below.">
|
||||
<ol class="space-y-6">
|
||||
<li v-for="reference in references" :key="reference.id">
|
||||
<p class="font-mono text-body-base text-accent">{{ reference.id }}</p>
|
||||
<p class="mt-1 max-w-prose text-body-base text-body">{{ reference.label }}</p>
|
||||
<p v-if="reference.url" class="mt-1">
|
||||
<a
|
||||
:href="reference.url"
|
||||
class="break-all text-body-base text-accent underline underline-offset-4"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-emerald-500 to-emerald-600 flex items-center justify-center flex-shrink-0">
|
||||
<i class="fas fa-check text-white text-sm"></i>
|
||||
</div>
|
||||
<span class="text-sm text-gray-700 dark:text-gray-300">{{ item }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Incident Protocol -->
|
||||
<section class="py-10 sm:py-14 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="flex items-center gap-3 mb-6">
|
||||
<div class="w-1 h-6 rounded-full bg-gradient-to-b from-red-500 to-orange-500"></div>
|
||||
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Incident Protocol</h2>
|
||||
</div>
|
||||
<div class="card p-6">
|
||||
<div class="relative">
|
||||
<!-- Flow line for desktop -->
|
||||
<div class="hidden sm:block absolute left-6 top-12 bottom-12 w-0.5 bg-gradient-to-b from-red-500 via-orange-500 via-amber-500 via-blue-500 to-green-500"></div>
|
||||
<div class="space-y-4">
|
||||
<div
|
||||
v-for="(step, index) in incidentProtocol"
|
||||
:key="step.step"
|
||||
class="flex items-start gap-4"
|
||||
>
|
||||
<div
|
||||
class="w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0 z-10 shadow-lg"
|
||||
:class="incidentColors[index]"
|
||||
>
|
||||
<span class="text-white font-bold">{{ index + 1 }}</span>
|
||||
</div>
|
||||
<div class="flex-1 pb-2 pt-2">
|
||||
<div class="font-semibold text-gray-900 dark:text-gray-100">{{ step.step.replace(/^\d+\.\s*/, '') }}</div>
|
||||
<div class="text-sm text-gray-600 dark:text-gray-400">{{ step.description }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Footer Note -->
|
||||
<section class="py-10 sm:py-14 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-4xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="card p-8">
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">
|
||||
BEAT v1.0 by <strong class="text-gray-900 dark:text-gray-100">Lukasz Raczylo</strong>
|
||||
{{ reference.url }}
|
||||
</a>
|
||||
</p>
|
||||
<p class="text-gray-500 dark:text-gray-500 text-sm italic">
|
||||
Attribution appreciated. Improvement welcomed. Dogma discouraged.
|
||||
<p v-else-if="reference.doi" class="mt-1 break-all text-body-base text-body">
|
||||
DOI {{ reference.doi }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<p class="mt-1 max-w-prose text-body-base text-muted-foreground">{{ reference.note }}</p>
|
||||
</li>
|
||||
</ol>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+27
-107
@@ -1,119 +1,39 @@
|
||||
<script setup>
|
||||
import TableCard from '@/components/ui/TableCard.vue'
|
||||
import { coreValues, teamValues } from '@/data/manifesto'
|
||||
|
||||
const coreValuesHeaders = ['We Value More', 'Over']
|
||||
const coreValuesRows = coreValues.map(v => [
|
||||
`<strong class="text-blue-600 dark:text-blue-400">${v.valueMore}</strong>`,
|
||||
v.over
|
||||
])
|
||||
import PageHeader from '@/components/layout/PageHeader.vue'
|
||||
import PageSection from '@/components/layout/PageSection.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- Hero -->
|
||||
<section class="relative pt-32 sm:pt-40 pb-16 sm:pb-20 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-rose-50 via-pink-50 to-purple-50 dark:from-gray-900 dark:via-rose-950/20 dark:to-pink-950/20 transition-colors duration-300"></div>
|
||||
<div class="absolute top-20 -left-20 w-96 h-96 bg-rose-400/20 dark:bg-rose-500/20 rounded-full filter blur-3xl animate-float"></div>
|
||||
<div class="absolute top-40 -right-20 w-80 h-80 bg-pink-400/20 dark:bg-pink-500/20 rounded-full filter blur-3xl animate-float animate-delay-2000"></div>
|
||||
<PageHeader
|
||||
eyebrow="Foundations"
|
||||
title="Values"
|
||||
:summary="`${coreValues.length} core values state what the team prefers. ${teamValues.length} team values state how the team behaves while doing it.`"
|
||||
/>
|
||||
|
||||
<div class="relative max-w-6xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-rose-100 dark:bg-rose-900/30 text-rose-700 dark:text-rose-300 text-sm font-medium mb-6 animate-fade-in-up">
|
||||
<i class="fas fa-heart"></i>
|
||||
Foundation
|
||||
<PageSection title="Core values" summary="A core value names the thing it prefers over the thing it gives up.">
|
||||
<dl class="space-y-5">
|
||||
<div v-for="value in coreValues" :key="value.valueMore" class="flex flex-col border-l-2 border-accent pl-3">
|
||||
<dt class="flex items-baseline gap-3 text-title font-semibold text-large">
|
||||
<i :class="value.icon" class="text-body-base leading-none text-accent" aria-hidden="true"></i>
|
||||
{{ value.valueMore }}
|
||||
</dt>
|
||||
<dd class="pl-7 text-body-base text-body">We choose this over {{ value.over }}.</dd>
|
||||
</div>
|
||||
<div class="w-20 h-20 rounded-2xl bg-gradient-to-br from-rose-500 to-pink-500 flex items-center justify-center mx-auto mb-8 animate-fade-in-up animate-delay-100 shadow-glow-blue">
|
||||
<i class="fas fa-heart text-white text-3xl"></i>
|
||||
</div>
|
||||
<h1 class="section-title animate-fade-in-up animate-delay-200">Values</h1>
|
||||
<p class="section-subtitle max-w-2xl mx-auto animate-fade-in-up animate-delay-300">
|
||||
The foundation of everything we do. What we value in our work and how we treat each other.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</dl>
|
||||
</PageSection>
|
||||
|
||||
<!-- Core Values -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">Core Values</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400 max-w-2xl mx-auto">
|
||||
While there is value in the items on the right, we value the items on the left more.
|
||||
</p>
|
||||
<PageSection title="Team values" summary="Each team value states the behaviour it requires, not an intention.">
|
||||
<dl class="space-y-6">
|
||||
<div v-for="value in teamValues" :key="value.name">
|
||||
<dt class="flex items-center gap-2 text-title font-semibold text-large">
|
||||
<i :class="value.icon" class="text-accent" aria-hidden="true"></i>
|
||||
{{ value.name }}
|
||||
</dt>
|
||||
<dd class="mt-1 max-w-prose text-body-base text-body">{{ value.description }}</dd>
|
||||
</div>
|
||||
|
||||
<TableCard :headers="coreValuesHeaders" :rows="coreValuesRows" />
|
||||
|
||||
<!-- Visual Cards -->
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6 mt-12">
|
||||
<div
|
||||
v-for="(value, index) in coreValues"
|
||||
:key="value.valueMore"
|
||||
class="card group"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-center gap-4 mb-4">
|
||||
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-blue-500 to-purple-500 flex items-center justify-center group-hover:scale-110 transition-all duration-300">
|
||||
<i :class="value.icon" class="text-white"></i>
|
||||
</div>
|
||||
<h3 class="font-semibold text-lg text-gray-900 dark:text-gray-100">{{ value.valueMore }}</h3>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-500">
|
||||
over <span class="text-gray-700 dark:text-gray-300">{{ value.over }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Team Values -->
|
||||
<section class="py-20 bg-gray-50 dark:bg-gray-800/30 transition-colors duration-300 relative overflow-hidden">
|
||||
<div class="absolute bottom-0 right-0 w-96 h-96 bg-purple-500/5 dark:bg-purple-500/10 rounded-full filter blur-3xl"></div>
|
||||
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6 relative">
|
||||
<div class="text-center mb-14">
|
||||
<h2 class="text-3xl sm:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4">The Five Team Values</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400 max-w-2xl mx-auto">
|
||||
Beyond what we value in our work, we hold these values in how we treat each other.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
<div
|
||||
v-for="(value, index) in teamValues"
|
||||
:key="value.name"
|
||||
class="card group p-8"
|
||||
:style="{ animationDelay: `${index * 100}ms` }"
|
||||
>
|
||||
<div class="flex items-center gap-5 mb-5">
|
||||
<div
|
||||
class="w-16 h-16 rounded-2xl bg-gradient-to-br flex items-center justify-center group-hover:scale-110 group-hover:rotate-3 transition-all duration-300"
|
||||
:class="value.gradient"
|
||||
>
|
||||
<i :class="value.icon" class="text-white text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-2xl font-bold text-gray-900 dark:text-gray-100">{{ value.name }}</h3>
|
||||
</div>
|
||||
<p class="text-gray-600 dark:text-gray-400 leading-relaxed">
|
||||
{{ value.description }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Summary -->
|
||||
<section class="py-20 bg-white dark:bg-gray-900 transition-colors duration-300">
|
||||
<div class="max-w-4xl mx-auto px-4 sm:px-6 text-center">
|
||||
<div class="glass p-10 sm:p-14 rounded-3xl relative overflow-hidden">
|
||||
<div class="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-rose-500 via-pink-500 to-purple-500"></div>
|
||||
|
||||
<h3 class="text-2xl font-bold text-gray-900 dark:text-gray-100 mb-6">Values in Action</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 leading-relaxed text-lg">
|
||||
These values are not just words on a page. They guide our daily decisions, how we interact with each other, and how we approach every piece of work. When in doubt, return to these values.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</dl>
|
||||
</PageSection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,15 +1,98 @@
|
||||
/**
|
||||
* Semantic token bridge between the Tailwind theme and the stylesheet.
|
||||
*
|
||||
* The nine contract tokens live as CSS custom properties in the stylesheet
|
||||
* (light values in `:root`, dark values in `.dark`):
|
||||
*
|
||||
* --color-background, --color-foreground, --color-muted,
|
||||
* --color-muted-foreground, --color-border, --color-accent,
|
||||
* --color-accent-foreground, --color-text-body, --color-text-large
|
||||
*
|
||||
* Every colour utility below reads its custom property, so no utility
|
||||
* hard-codes a palette hex value and a theme swap only touches the stylesheet.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resolve a semantic token to its CSS custom property.
|
||||
*
|
||||
* The base utility gets the plain `var()` reference. Opacity modifiers
|
||||
* (`bg-background/50`) need an alpha channel, which a bare `var()` cannot
|
||||
* carry, so those get `color-mix()` instead of being dropped from the build.
|
||||
*/
|
||||
const token = (name) => ({ opacityValue }) => {
|
||||
const value = `var(--color-${name})`;
|
||||
if (opacityValue === undefined) return value;
|
||||
const ratio = typeof opacityValue === 'number' ? opacityValue : Number.parseFloat(opacityValue);
|
||||
// The base utility reports its opacity as the `var(--tw-*-opacity, 1)` fallback.
|
||||
if (!Number.isFinite(ratio)) return value;
|
||||
return `color-mix(in srgb, ${value} ${ratio * 100}%, transparent)`;
|
||||
};
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.{vue,js,ts,jsx,tsx}",
|
||||
],
|
||||
// Keep the semantic utilities in the bundle even before a component
|
||||
// references them, so the token layer ships as a whole. Dark mode needs no
|
||||
// extra entries: the custom properties swap values under `.dark`.
|
||||
safelist: [
|
||||
'bg-background', 'bg-foreground', 'bg-muted', 'bg-muted-foreground', 'bg-border', 'bg-accent', 'bg-accent-foreground', 'bg-body', 'bg-large',
|
||||
'text-background', 'text-foreground', 'text-muted', 'text-muted-foreground', 'text-border', 'text-accent', 'text-accent-foreground', 'text-body', 'text-large',
|
||||
'border-background', 'border-foreground', 'border-muted', 'border-muted-foreground', 'border-border', 'border-accent', 'border-accent-foreground', 'border-body', 'border-large',
|
||||
'text-body-base', 'text-body-lg', 'text-title', 'text-heading', 'text-heading-lg', 'text-display-sm', 'text-display',
|
||||
'font-sans', 'font-mono',
|
||||
// Opacity modifiers resolve through `color-mix()`, so the common steps
|
||||
// ship with the token layer instead of being dropped from the build.
|
||||
'bg-background/50', 'bg-background/80', 'bg-muted/50', 'bg-accent/50',
|
||||
'text-foreground/70', 'text-muted/80', 'text-accent/80', 'border-border/50',
|
||||
],
|
||||
darkMode: 'class',
|
||||
theme: {
|
||||
extend: {
|
||||
// Semantic colour tokens. Every value is a CSS custom property read
|
||||
// from the stylesheet, so a palette change happens in one place and no
|
||||
// utility hard-codes a hex value.
|
||||
colors: {
|
||||
background: token('background'),
|
||||
foreground: token('foreground'),
|
||||
muted: token('muted'),
|
||||
'muted-foreground': token('muted-foreground'),
|
||||
border: token('border'),
|
||||
accent: token('accent'),
|
||||
'accent-foreground': token('accent-foreground'),
|
||||
// The contract names the last two tokens "text-body" and "text-large".
|
||||
// Their colour keys keep the token's own name, so the utility that
|
||||
// reads `--color-text-body` is `text-body` and the one that reads
|
||||
// `--color-text-large` is `text-large`. The type scale uses
|
||||
// `body-base`, so no class name carries two rules.
|
||||
body: token('text-body'),
|
||||
large: token('text-large'),
|
||||
},
|
||||
// System font stacks: no webfont download, no font CDN request.
|
||||
fontFamily: {
|
||||
sans: ['Inter', 'system-ui', 'sans-serif'],
|
||||
mono: ['JetBrains Mono', 'monospace'],
|
||||
sans: [
|
||||
'system-ui',
|
||||
'-apple-system',
|
||||
'BlinkMacSystemFont',
|
||||
'"Segoe UI"',
|
||||
'Roboto',
|
||||
'"Helvetica Neue"',
|
||||
'Arial',
|
||||
'"Noto Sans"',
|
||||
'sans-serif',
|
||||
],
|
||||
mono: [
|
||||
'ui-monospace',
|
||||
'SFMono-Regular',
|
||||
'Menlo',
|
||||
'Monaco',
|
||||
'Consolas',
|
||||
'"Liberation Mono"',
|
||||
'"Courier New"',
|
||||
'monospace',
|
||||
],
|
||||
},
|
||||
// Extended screens for better responsive control
|
||||
screens: {
|
||||
@@ -22,13 +105,20 @@ export default {
|
||||
'8xl': '88rem',
|
||||
'9xl': '96rem',
|
||||
},
|
||||
// Responsive font sizes
|
||||
// Type scale. The body step is 16px with a 1.6 line height, and three
|
||||
// heading steps sit above it: title (20px), heading (24px), heading-lg
|
||||
// (30px). The display steps keep their fluid clamps because their
|
||||
// smallest size stays well above the heading steps. The body step is
|
||||
// named `body-base` so it does not collide with the colour token
|
||||
// `--color-text-body`, whose utility is `text-body`.
|
||||
fontSize: {
|
||||
'display': ['clamp(2.5rem, 8vw, 6rem)', { lineHeight: '1.1', letterSpacing: '-0.02em' }],
|
||||
'display-sm': ['clamp(2rem, 5vw, 3.5rem)', { lineHeight: '1.15', letterSpacing: '-0.02em' }],
|
||||
'title': ['clamp(1.5rem, 4vw, 2.5rem)', { lineHeight: '1.2', letterSpacing: '-0.01em' }],
|
||||
'body-lg': ['clamp(1rem, 1.5vw, 1.25rem)', { lineHeight: '1.7' }],
|
||||
'body': ['clamp(0.875rem, 1.2vw, 1rem)', { lineHeight: '1.6' }],
|
||||
'heading-lg': ['1.875rem', { lineHeight: '1.3', letterSpacing: '-0.01em' }],
|
||||
'heading': ['1.5rem', { lineHeight: '1.4', letterSpacing: '-0.01em' }],
|
||||
'title': ['1.25rem', { lineHeight: '1.5', letterSpacing: '-0.005em' }],
|
||||
'body-lg': ['1.125rem', { lineHeight: '1.6' }],
|
||||
'body-base': ['1rem', { lineHeight: '1.6' }],
|
||||
},
|
||||
animation: {
|
||||
'fade-in': 'fadeIn 0.6s ease-out forwards',
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
# Banned terms for the BEAT site copy and the README headings.
|
||||
#
|
||||
# Format: one entry per line. Lines starting with "#" are comments, blank lines
|
||||
# are ignored. The list is data only: scripts/check-banned-terms.mjs reads this
|
||||
# file, so the list can be tuned without touching the script.
|
||||
#
|
||||
# Matching: a single word matches case-insensitively on word boundaries. A
|
||||
# multi-word phrase matches case-insensitively, and a space in the phrase
|
||||
# matches any run of spaces, hyphens or underscores, so "world-class" also
|
||||
# matches "world class".
|
||||
#
|
||||
# Scope: promotional superlatives, promotional claims and hype adjectives.
|
||||
# Ordinary prose words are deliberately left out of this list.
|
||||
|
||||
# --- Superlatives ---
|
||||
best
|
||||
perfect
|
||||
premium
|
||||
ultimate
|
||||
world-class
|
||||
best-in-class
|
||||
top-notch
|
||||
state-of-the-art
|
||||
greatest
|
||||
finest
|
||||
|
||||
# --- Promotional claims ---
|
||||
revolutionary
|
||||
game-changing
|
||||
cutting-edge
|
||||
next-generation
|
||||
bleeding-edge
|
||||
disruptive
|
||||
transformative
|
||||
groundbreaking
|
||||
unleash
|
||||
supercharge
|
||||
unlock
|
||||
one-stop
|
||||
turnkey
|
||||
10x
|
||||
|
||||
# --- Hype adjectives ---
|
||||
seamless
|
||||
seamlessly
|
||||
effortless
|
||||
effortlessly
|
||||
frictionless
|
||||
delightful
|
||||
stunning
|
||||
beautiful
|
||||
blazing
|
||||
blazingly
|
||||
powerful
|
||||
robust
|
||||
lightning-fast
|
||||
incredible
|
||||
amazing
|
||||
tremendous
|
||||
|
||||
# --- Phrases found in the current copy ---
|
||||
dramatically increase
|
||||
level up
|
||||
congratulations
|
||||
transform your
|
||||
everything you need
|
||||
|
||||
# --- Words seen in the current copy and added on purpose ---
|
||||
excellent
|
||||
@@ -0,0 +1,942 @@
|
||||
/**
|
||||
* Manual WCAG 2.2 AA checks for the BEAT site, run in a real browser.
|
||||
*
|
||||
* The script drives the built site over HTTP and records, for every route:
|
||||
*
|
||||
* 1. Keyboard operability: every interactive element is reachable with
|
||||
* Tab, the focus order follows the visual order, and the focused
|
||||
* element shows a visible focus indicator (outline, box-shadow or a
|
||||
* border colour change against the un-focused state).
|
||||
* 2. Landmarks and heading order: one banner, one main, one contentinfo,
|
||||
* at most one navigation landmark per group, exactly one h1, and no
|
||||
* skipped heading level.
|
||||
* 3. Meaningful link text: every link has an accessible name that
|
||||
* describes its destination, and no link is named "click here",
|
||||
* "read more", "here", "link" or a bare URL.
|
||||
* 4. Alt text: every image carries an alt attribute; an informative image
|
||||
* has text, a decorative image has an empty alt.
|
||||
* 5. Measured contrast: the computed foreground and background colours of
|
||||
* every text node, its size and weight, compared against the WCAG
|
||||
* thresholds (4.5:1 for body text, 3:1 for large text).
|
||||
*
|
||||
* The script prints the raw measurements and writes a JSON file. It does
|
||||
* not change any application code.
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-a11y-manual.mjs [--dist <dir>] [--browser <path>]
|
||||
* [--json <file>] [--help]
|
||||
*
|
||||
* Exit codes: 0 = every check passed, 1 = at least one check failed,
|
||||
* 2 = usage or I/O error.
|
||||
*/
|
||||
|
||||
import { createServer } from 'node:http'
|
||||
import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs'
|
||||
import { createRequire } from 'node:module'
|
||||
import { dirname, extname, join, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import vm from 'node:vm'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
const DEFAULT_DIST = join(REPO_ROOT, 'public', 'dist')
|
||||
const DEFAULT_ROUTER = join(REPO_ROOT, 'public', 'src', 'router', 'index.js')
|
||||
const SITE_REQUIRE = createRequire(join(REPO_ROOT, 'public', 'package.json'))
|
||||
|
||||
const THEME_STORAGE_KEY = 'beat-theme'
|
||||
|
||||
/** Viewports to check: the mobile width and the desktop width of the brief. */
|
||||
const WIDTHS = [
|
||||
{ name: '360', width: 360, height: 800 },
|
||||
{ name: '1440', width: 1440, height: 900 },
|
||||
]
|
||||
|
||||
/** The two themes. */
|
||||
const THEMES = ['light', 'dark']
|
||||
|
||||
/** Link names that describe nothing about the destination. */
|
||||
const MEANINGLESS_LINK_NAMES = [
|
||||
'click here', 'here', 'read more', 'more', 'link', 'this', 'this page',
|
||||
'learn more', 'continue', 'details', 'see more', 'read this',
|
||||
]
|
||||
|
||||
const usage = `Usage: node scripts/check-a11y-manual.mjs [options]
|
||||
|
||||
--dist <dir> built site to check (default: public/dist)
|
||||
--router <file> router config to read the route list from
|
||||
--browser <path> Chromium executable to drive
|
||||
--json <file> write the measurements to this file
|
||||
--help print this text
|
||||
Exit codes: 0 = every check passed, 1 = a check failed, 2 = usage or I/O error.`
|
||||
|
||||
/* ------------------------------------------------------------------ options */
|
||||
|
||||
function readOptions (argv) {
|
||||
const flags = new Map([['--help', 'help'], ['-h', 'help']])
|
||||
const takesValue = new Map([['--dist', 'dist'], ['--router', 'router'], ['--browser', 'browser'], ['--json', 'json']])
|
||||
const options = { dist: DEFAULT_DIST, router: DEFAULT_ROUTER, browser: null, json: null, help: false }
|
||||
|
||||
for (let index = 0; index < argv.length; index++) {
|
||||
const argument = argv[index]
|
||||
if (argument.startsWith('-')) {
|
||||
const flag = flags.get(argument)
|
||||
if (flag !== undefined) {
|
||||
options[flag] = true
|
||||
continue
|
||||
}
|
||||
const key = takesValue.get(argument)
|
||||
if (key === undefined) throw new Error(`unknown option: ${argument}`)
|
||||
const value = argv[index + 1]
|
||||
if (value === undefined) throw new Error(`option ${argument} needs a value`)
|
||||
options[key] = resolve(value)
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
throw new Error(`unexpected argument: ${argument}`)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- route table */
|
||||
|
||||
function matchingBracket (source, start) {
|
||||
const pairs = { '[': ']', '{': '}', '(': ')' }
|
||||
const open = source[start]
|
||||
const close = pairs[open]
|
||||
if (close === undefined) return -1
|
||||
|
||||
let depth = 0
|
||||
let index = start
|
||||
let state = 'code'
|
||||
while (index < source.length) {
|
||||
const character = source[index]
|
||||
const next = source[index + 1]
|
||||
if (state === 'code') {
|
||||
if (character === '/' && next === '/') { state = 'line'; index += 2; continue }
|
||||
if (character === '/' && next === '*') { state = 'block'; index += 2; continue }
|
||||
if (character === '"') { state = 'double'; index += 1; continue }
|
||||
if (character === "'") { state = 'single'; index += 1; continue }
|
||||
if (character === '`') { state = 'template'; index += 1; continue }
|
||||
if (character === open) depth += 1
|
||||
else if (character === close) {
|
||||
depth -= 1
|
||||
if (depth === 0) return index
|
||||
}
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (state === 'line') {
|
||||
if (character === '\n') state = 'code'
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (state === 'block') {
|
||||
if (character === '*' && next === '/') state = 'code'
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (character === '\\') { index += 2; continue }
|
||||
if ((state === 'single' && character === "'") ||
|
||||
(state === 'double' && character === '"') ||
|
||||
(state === 'template' && character === '`')) state = 'code'
|
||||
index += 1
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
function normalizePath (value) {
|
||||
if (typeof value !== 'string') return null
|
||||
let path = value.trim()
|
||||
if (path === '') return null
|
||||
if (!path.startsWith('/')) path = `/${path}`
|
||||
const cut = path.search(/[?#]/)
|
||||
if (cut !== -1) path = path.slice(0, cut)
|
||||
if (path.length > 1) path = path.replace(/\/+$/, '')
|
||||
return path
|
||||
}
|
||||
|
||||
function readRouterRoutes (routerPath) {
|
||||
const source = readFileSync(routerPath, 'utf8')
|
||||
const declaration = /(?:export\s+)?const\s+routes\s*=\s*/.exec(source)
|
||||
if (declaration === null) throw new Error(`no "const routes = ..." in ${routerPath}`)
|
||||
const start = source.indexOf('[', declaration.index + declaration[0].length)
|
||||
if (start === -1) throw new Error(`the routes export in ${routerPath} is not an array literal`)
|
||||
const end = matchingBracket(source, start)
|
||||
if (end === -1) throw new Error(`the routes array in ${routerPath} is not closed`)
|
||||
const literal = source.slice(start, end + 1)
|
||||
|
||||
const routes = vm.runInNewContext(`(${literal})`, Object.create(null), {
|
||||
importModuleDynamically: (specifier) => {
|
||||
throw new Error(`the router file must not be executed, but it imports ${specifier}`)
|
||||
}
|
||||
})
|
||||
if (!Array.isArray(routes)) throw new Error(`the routes export in ${routerPath} is not an array`)
|
||||
|
||||
const entries = []
|
||||
for (const route of routes) {
|
||||
const path = normalizePath(route.path)
|
||||
if (path === null) continue
|
||||
entries.push({
|
||||
path,
|
||||
name: typeof route.name === 'string' ? route.name : null,
|
||||
title: route.meta && typeof route.meta.title === 'string' ? route.meta.title : null,
|
||||
isCatchAll: path.includes('*'),
|
||||
})
|
||||
}
|
||||
return entries
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------- static server */
|
||||
|
||||
const MIME_TYPES = {
|
||||
'.html': 'text/html; charset=utf-8',
|
||||
'.js': 'text/javascript; charset=utf-8',
|
||||
'.css': 'text/css; charset=utf-8',
|
||||
'.svg': 'image/svg+xml',
|
||||
'.png': 'image/png',
|
||||
'.json': 'application/json; charset=utf-8',
|
||||
'.woff2': 'font/woff2',
|
||||
}
|
||||
|
||||
function startServer (distDir) {
|
||||
const server = createServer((request, response) => {
|
||||
const requested = decodeURIComponent((request.url ?? '/').split('?')[0].split('#')[0])
|
||||
const relative = requested.replace(/^\/+/, '')
|
||||
const candidate = relative === '' ? 'index.html' : relative
|
||||
|
||||
let filePath = join(distDir, candidate)
|
||||
if (!existsSync(filePath) || !statSync(filePath).isFile()) {
|
||||
const fallback = join(distDir, '404.html')
|
||||
filePath = existsSync(fallback) ? fallback : join(distDir, 'index.html')
|
||||
}
|
||||
|
||||
const type = MIME_TYPES[extname(filePath).toLowerCase()] ?? 'application/octet-stream'
|
||||
const body = readFileSync(filePath)
|
||||
response.writeHead(200, { 'Content-Type': type, 'Content-Length': body.length })
|
||||
response.end(body)
|
||||
})
|
||||
|
||||
return new Promise((resolveServer, rejectServer) => {
|
||||
server.on('error', rejectServer)
|
||||
server.listen(0, '127.0.0.1', () => {
|
||||
const address = server.address()
|
||||
resolveServer({ server, origin: `http://127.0.0.1:${address.port}` })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------- in-page check code */
|
||||
|
||||
/**
|
||||
* The checks that run inside the page.
|
||||
*
|
||||
* They are injected as a string, so they cannot use the outer scope; every
|
||||
* helper they need is defined inside the function.
|
||||
*/
|
||||
const PAGE_CHECKS = `(() => {
|
||||
const results = {}
|
||||
|
||||
/* ---------------------------------------------------------- colour maths */
|
||||
|
||||
const parseColor = (value) => {
|
||||
const match = /rgba?\\(([^)]+)\\)/.exec(value)
|
||||
if (match === null) return null
|
||||
const parts = match[1].split(',').map((part) => Number.parseFloat(part.trim()))
|
||||
if (parts.length < 3 || parts.some((part) => Number.isNaN(part))) return null
|
||||
return { r: parts[0], g: parts[1], b: parts[2], a: parts.length > 3 ? parts[3] : 1 }
|
||||
}
|
||||
|
||||
const channelLuminance = (channel) => {
|
||||
const value = channel / 255
|
||||
return value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4
|
||||
}
|
||||
|
||||
const relativeLuminance = (color) => (
|
||||
0.2126 * channelLuminance(color.r) +
|
||||
0.7152 * channelLuminance(color.g) +
|
||||
0.0722 * channelLuminance(color.b)
|
||||
)
|
||||
|
||||
const contrastRatio = (foreground, background) => {
|
||||
const a = relativeLuminance(foreground)
|
||||
const b = relativeLuminance(background)
|
||||
const lighter = Math.max(a, b)
|
||||
const darker = Math.min(a, b)
|
||||
return (lighter + 0.05) / (darker + 0.05)
|
||||
}
|
||||
|
||||
/** The opaque background behind an element, walking up the tree. */
|
||||
const effectiveBackground = (element) => {
|
||||
let node = element
|
||||
while (node !== null && node.nodeType === 1) {
|
||||
const color = parseColor(getComputedStyle(node).backgroundColor)
|
||||
if (color !== null && color.a > 0) {
|
||||
if (color.a === 1) return color
|
||||
// A translucent background is composited over its own backdrop.
|
||||
const parent = effectiveBackground(node.parentElement)
|
||||
if (parent === null) return color
|
||||
return {
|
||||
r: color.r * color.a + parent.r * (1 - color.a),
|
||||
g: color.g * color.a + parent.g * (1 - color.a),
|
||||
b: color.b * color.a + parent.b * (1 - color.a),
|
||||
a: 1
|
||||
}
|
||||
}
|
||||
node = node.parentElement
|
||||
}
|
||||
return { r: 255, g: 255, b: 255, a: 1 }
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- landmarks */
|
||||
|
||||
// The landmark role of an element follows the HTML-AAM rules: a header or
|
||||
// footer is a banner or a contentinfo only at the top level of the
|
||||
// document. A header inside main, article, aside, nav or section is a
|
||||
// plain section heading and carries no landmark role.
|
||||
const sectioningAncestor = 'article, aside, main, nav, section'
|
||||
const landmarkRole = (element) => {
|
||||
const explicit = element.getAttribute('role')
|
||||
if (explicit !== null && explicit !== '') return explicit
|
||||
const tag = element.tagName.toLowerCase()
|
||||
if (tag === 'main') return 'main'
|
||||
if (tag === 'nav') return 'navigation'
|
||||
if (tag === 'aside') return 'complementary'
|
||||
if (tag === 'header') return element.closest(sectioningAncestor) === null ? 'banner' : 'generic'
|
||||
if (tag === 'footer') return element.closest(sectioningAncestor) === null ? 'contentinfo' : 'generic'
|
||||
return null
|
||||
}
|
||||
|
||||
const landmarks = []
|
||||
for (const element of document.querySelectorAll('header, nav, main, aside, footer, [role="banner"], [role="navigation"], [role="main"], [role="contentinfo"], [role="complementary"], [role="search"]')) {
|
||||
const role = landmarkRole(element)
|
||||
if (role === null) continue
|
||||
landmarks.push({
|
||||
role,
|
||||
label: element.getAttribute('aria-label') ?? '',
|
||||
heading: (element.querySelector('a, button, [class*="text-"]')?.textContent ?? '').trim().slice(0, 60)
|
||||
})
|
||||
}
|
||||
results.landmarks = landmarks
|
||||
|
||||
const count = (role) => landmarks.filter((landmark) => landmark.role === role).length
|
||||
results.landmarkCounts = {
|
||||
banner: count('banner'),
|
||||
navigation: count('navigation'),
|
||||
main: count('main'),
|
||||
contentinfo: count('contentinfo'),
|
||||
complementary: count('complementary'),
|
||||
search: count('search')
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------- heading order */
|
||||
|
||||
const headings = []
|
||||
for (const element of document.querySelectorAll('h1, h2, h3, h4, h5, h6')) {
|
||||
if (element.closest('[aria-hidden="true"]')) continue
|
||||
const style = getComputedStyle(element)
|
||||
if (style.display === 'none' || style.visibility === 'hidden') continue
|
||||
headings.push({
|
||||
level: Number.parseInt(element.tagName.slice(1), 10),
|
||||
text: element.textContent.trim().replace(/\\s+/g, ' ').slice(0, 80),
|
||||
target: element.id === '' ? element.tagName.toLowerCase() : '#' + element.id
|
||||
})
|
||||
}
|
||||
results.headings = headings
|
||||
results.h1Count = headings.filter((heading) => heading.level === 1).length
|
||||
results.headingSkips = []
|
||||
let previous = null
|
||||
for (const heading of headings) {
|
||||
if (previous !== null && heading.level > previous + 1) {
|
||||
results.headingSkips.push({ from: previous, to: heading.level, text: heading.text })
|
||||
}
|
||||
previous = heading.level
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- link text */
|
||||
|
||||
const links = []
|
||||
for (const anchor of document.querySelectorAll('a[href]')) {
|
||||
const style = getComputedStyle(anchor)
|
||||
if (style.display === 'none' || style.visibility === 'hidden') continue
|
||||
const name = (anchor.getAttribute('aria-label') ?? anchor.textContent ?? '').trim().replace(/\\s+/g, ' ')
|
||||
// A link whose text is its own URL is only acceptable inside a reference
|
||||
// entry: the entry itself carries the citation id and the label, so the
|
||||
// link is not the only way to find out what it points at.
|
||||
const entry = anchor.closest('li')
|
||||
let labelledEntry = false
|
||||
if (entry !== null) {
|
||||
labelledEntry = Array.from(entry.querySelectorAll('p, h2, h3, h4, dt, dd')).some((node) => {
|
||||
const text = node.textContent.trim().replace(/\\s+/g, ' ')
|
||||
return text.length > 0 && text !== name
|
||||
})
|
||||
}
|
||||
links.push({
|
||||
href: anchor.getAttribute('href'),
|
||||
name,
|
||||
text: anchor.textContent.trim().replace(/\\s+/g, ' ').slice(0, 80),
|
||||
title: anchor.getAttribute('title') ?? '',
|
||||
bareUrl: /^https?:\\/\\//.test(name),
|
||||
labelledEntry
|
||||
})
|
||||
}
|
||||
results.links = links
|
||||
|
||||
/* -------------------------------------------------------------- alt text */
|
||||
|
||||
const images = []
|
||||
for (const image of document.querySelectorAll('img')) {
|
||||
images.push({
|
||||
src: image.getAttribute('src'),
|
||||
alt: image.getAttribute('alt'),
|
||||
hasAlt: image.hasAttribute('alt'),
|
||||
ariaHidden: image.getAttribute('aria-hidden') === 'true'
|
||||
})
|
||||
}
|
||||
for (const svg of document.querySelectorAll('svg')) {
|
||||
images.push({
|
||||
src: 'inline <svg>',
|
||||
alt: svg.getAttribute('aria-label'),
|
||||
hasAlt: svg.hasAttribute('aria-label'),
|
||||
ariaHidden: svg.getAttribute('aria-hidden') === 'true'
|
||||
})
|
||||
}
|
||||
results.images = images
|
||||
|
||||
/* --------------------------------------------------------------- contrast */
|
||||
|
||||
const contrast = []
|
||||
const seen = new Set()
|
||||
for (const element of document.querySelectorAll('body *')) {
|
||||
const style = getComputedStyle(element)
|
||||
if (style.display === 'none' || style.visibility === 'hidden') continue
|
||||
if (style.opacity === '0') continue
|
||||
|
||||
// Only elements that own a text node are measured: a wrapper that only
|
||||
// holds children does not paint text of its own.
|
||||
const ownsText = [...element.childNodes].some((node) => node.nodeType === 3 && node.textContent.trim() !== '')
|
||||
if (!ownsText) continue
|
||||
|
||||
const foreground = parseColor(style.color)
|
||||
if (foreground === null) continue
|
||||
const background = effectiveBackground(element)
|
||||
const ratio = contrastRatio(foreground, background)
|
||||
const fontSize = Number.parseFloat(style.fontSize)
|
||||
const fontWeight = Number.parseInt(style.fontWeight, 10) || 400
|
||||
const isLarge = fontSize >= 24 || (fontSize >= 18.66 && fontWeight >= 700)
|
||||
const required = isLarge ? 3 : 4.5
|
||||
|
||||
const key = element.tagName + '|' + style.color + '|' + style.backgroundColor + '|' + element.className
|
||||
if (seen.has(key)) continue
|
||||
seen.add(key)
|
||||
|
||||
contrast.push({
|
||||
tag: element.tagName.toLowerCase(),
|
||||
className: typeof element.className === 'string' ? element.className.slice(0, 120) : '',
|
||||
text: element.textContent.trim().replace(/\\s+/g, ' ').slice(0, 60),
|
||||
color: style.color,
|
||||
background: 'rgb(' + Math.round(background.r) + ', ' + Math.round(background.g) + ', ' + Math.round(background.b) + ')',
|
||||
fontSize,
|
||||
fontWeight,
|
||||
isLarge,
|
||||
required,
|
||||
ratio: Math.round(ratio * 100) / 100,
|
||||
passes: ratio >= required
|
||||
})
|
||||
}
|
||||
results.contrast = contrast
|
||||
|
||||
/* ------------------------------------------------- interactive elements */
|
||||
|
||||
// The counter lives on the window, so a second run over the same page (the
|
||||
// mobile menu open) hands out the ids it already gave, and only new
|
||||
// elements get a new one.
|
||||
if (window.__a11yCheckCounter === undefined) window.__a11yCheckCounter = 0
|
||||
|
||||
const interactive = []
|
||||
// A scope limits the scan to one part of the page, for example the menu
|
||||
// that the small-screen navigation opens.
|
||||
const scope = window.__a11yScope ?? null
|
||||
const scopeRoot = scope === null ? document : document.querySelector(scope)
|
||||
if (scopeRoot !== null) {
|
||||
for (const element of scopeRoot.querySelectorAll('a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])')) {
|
||||
const style = getComputedStyle(element)
|
||||
if (style.display === 'none' || style.visibility === 'hidden') continue
|
||||
// An element inside a hidden ancestor has no box, so it cannot take
|
||||
// focus: the desktop navigation is hidden on small screens.
|
||||
if (element.getClientRects().length === 0) continue
|
||||
if (!element.hasAttribute('data-a11y-check-id')) {
|
||||
window.__a11yCheckCounter += 1
|
||||
element.setAttribute('data-a11y-check-id', 'a11y-interactive-' + window.__a11yCheckCounter)
|
||||
}
|
||||
const id = element.getAttribute('data-a11y-check-id')
|
||||
const type = element.getAttribute('type')
|
||||
interactive.push({
|
||||
id,
|
||||
tag: element.tagName.toLowerCase(),
|
||||
text: (element.textContent ?? element.getAttribute('aria-label') ?? '').trim().replace(/\\s+/g, ' ').slice(0, 60),
|
||||
href: element.getAttribute('href'),
|
||||
tabindex: element.getAttribute('tabindex'),
|
||||
inputType: type,
|
||||
value: element.getAttribute('value'),
|
||||
// Radios that share a name are one group and therefore one tab stop.
|
||||
radioGroup: type === 'radio' ? (element.getAttribute('name') ?? '') : null
|
||||
})
|
||||
}
|
||||
}
|
||||
results.interactive = interactive
|
||||
|
||||
return results
|
||||
})()`
|
||||
|
||||
/* ------------------------------------------------------- keyboard walking */
|
||||
|
||||
/**
|
||||
* Walk the focus order with the keyboard and record what each stop looks
|
||||
* like, so the focus indicator can be compared against the resting state.
|
||||
*/
|
||||
async function walkFocus (page, { withinMenu = false } = {}) {
|
||||
await page.evaluate((menuOnly) => {
|
||||
if (document.activeElement !== null && document.activeElement !== document.body) {
|
||||
document.activeElement.blur()
|
||||
}
|
||||
if (menuOnly) {
|
||||
const menu = document.querySelector('#site-menu')
|
||||
if (menu !== null) {
|
||||
const first = menu.querySelector('a[href], button, input, select, textarea, [tabindex]')
|
||||
if (first !== null) first.focus()
|
||||
}
|
||||
}
|
||||
}, withinMenu)
|
||||
|
||||
const readStop = async () => await page.evaluate((menuOnly) => {
|
||||
const element = document.activeElement
|
||||
if (element === null || element === document.body) return null
|
||||
if (menuOnly) {
|
||||
const menu = document.querySelector('#site-menu')
|
||||
if (menu === null || !menu.contains(element)) return null
|
||||
}
|
||||
const style = getComputedStyle(element)
|
||||
const rect = element.getBoundingClientRect()
|
||||
// The position of the element in the document, so the focus order can
|
||||
// be compared with the order the elements appear in.
|
||||
const all = document.querySelectorAll('*')
|
||||
let domIndex = -1
|
||||
for (let position = 0; position < all.length; position++) {
|
||||
if (all[position] === element) { domIndex = position; break }
|
||||
}
|
||||
return {
|
||||
id: element.getAttribute('data-a11y-check-id') ?? '',
|
||||
tag: element.tagName.toLowerCase(),
|
||||
text: (element.textContent ?? element.getAttribute('aria-label') ?? '').trim().replace(/\s+/g, ' ').slice(0, 60),
|
||||
href: element.getAttribute('href'),
|
||||
type: element.getAttribute('type'),
|
||||
name: element.getAttribute('name'),
|
||||
domIndex,
|
||||
outlineStyle: style.outlineStyle,
|
||||
outlineWidth: style.outlineWidth,
|
||||
outlineColor: style.outlineColor,
|
||||
outlineOffset: style.outlineOffset,
|
||||
boxShadow: style.boxShadow,
|
||||
borderColor: style.borderColor,
|
||||
backgroundColor: style.backgroundColor,
|
||||
color: style.color,
|
||||
top: Math.round(rect.top),
|
||||
left: Math.round(rect.left),
|
||||
width: Math.round(rect.width),
|
||||
height: Math.round(rect.height)
|
||||
}
|
||||
}, withinMenu)
|
||||
|
||||
const stops = []
|
||||
const limit = 200
|
||||
// The first element of the menu already has the focus, so it is read
|
||||
// before the first Tab press. On the page itself nothing is focused yet,
|
||||
// so the walk starts with Tab.
|
||||
if (withinMenu) {
|
||||
const first = await readStop()
|
||||
if (first === null) return stops
|
||||
stops.push(first)
|
||||
}
|
||||
for (let index = 0; index < limit; index++) {
|
||||
await page.keyboard.press('Tab')
|
||||
const stop = await readStop()
|
||||
if (stop === null) break
|
||||
stops.push(stop)
|
||||
// A focus cycle that repeats the first stop has come full circle.
|
||||
if (stops.length > 1 && stops[0].id === stop.id) break
|
||||
}
|
||||
return stops
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the small-screen navigation menu with the keyboard and close it again
|
||||
* with Escape, so the links behind the button are checked as well.
|
||||
*
|
||||
* The button is found by its accessible name, because it has no id of its
|
||||
* own. When the button is not on the page (the desktop layout has no menu),
|
||||
* the caller is told so instead of getting a failure.
|
||||
*/
|
||||
async function openMenuWithKeyboard (page) {
|
||||
const button = page.locator('button[aria-controls="site-menu"]')
|
||||
if (await button.count() === 0) return { opened: false, reason: 'no menu button on this page' }
|
||||
if (!await button.isVisible()) return { opened: false, reason: 'the menu button is hidden at this width' }
|
||||
|
||||
await button.focus()
|
||||
await page.keyboard.press('Enter')
|
||||
await page.waitForTimeout(120)
|
||||
|
||||
const opened = await page.evaluate(() => {
|
||||
const menu = document.querySelector('#site-menu')
|
||||
const trigger = document.querySelector('button[aria-controls="site-menu"]')
|
||||
return {
|
||||
present: menu !== null,
|
||||
expanded: trigger?.getAttribute('aria-expanded') ?? null
|
||||
}
|
||||
})
|
||||
if (!opened.present || opened.expanded !== 'true') {
|
||||
return { opened: false, reason: 'the menu did not open when the button was activated with Enter' }
|
||||
}
|
||||
return { opened: true }
|
||||
}
|
||||
|
||||
/**
|
||||
* The resting appearance of the same elements, so a focus indicator can be
|
||||
* told apart from the normal state.
|
||||
*/
|
||||
async function readRestingStyles (page) {
|
||||
return page.evaluate(() => {
|
||||
const resting = []
|
||||
for (const element of document.querySelectorAll('a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])')) {
|
||||
const style = getComputedStyle(element)
|
||||
resting.push({
|
||||
id: element.getAttribute('data-a11y-check-id') ?? '',
|
||||
tag: element.tagName.toLowerCase(),
|
||||
text: (element.textContent ?? element.getAttribute('aria-label') ?? '').trim().replace(/\s+/g, ' ').slice(0, 60),
|
||||
outlineStyle: style.outlineStyle,
|
||||
outlineWidth: style.outlineWidth,
|
||||
outlineColor: style.outlineColor,
|
||||
boxShadow: style.boxShadow,
|
||||
borderColor: style.borderColor,
|
||||
backgroundColor: style.backgroundColor
|
||||
})
|
||||
}
|
||||
return resting
|
||||
})
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------- main */
|
||||
|
||||
async function main (argv) {
|
||||
const options = readOptions(argv)
|
||||
if (options.help) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
if (!existsSync(options.dist)) throw new Error(`cannot read the built site: ${options.dist} does not exist`)
|
||||
if (!existsSync(options.router)) throw new Error(`cannot read the router config: ${options.router} does not exist`)
|
||||
|
||||
const routes = readRouterRoutes(options.router)
|
||||
const { chromium } = SITE_REQUIRE('playwright-core')
|
||||
const { server, origin } = await startServer(options.dist)
|
||||
const launchOptions = { args: ['--no-sandbox'] }
|
||||
if (options.browser !== null) launchOptions.executablePath = options.browser
|
||||
const browser = await chromium.launch(launchOptions)
|
||||
|
||||
const report = { routes: [], failures: [] }
|
||||
|
||||
try {
|
||||
for (const theme of THEMES) {
|
||||
for (const viewport of WIDTHS) {
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: viewport.width, height: viewport.height },
|
||||
colorScheme: theme,
|
||||
deviceScaleFactor: 1,
|
||||
})
|
||||
await context.addInitScript(
|
||||
([key, value]) => {
|
||||
try { window.localStorage.setItem(key, value) } catch { /* storage blocked */ }
|
||||
},
|
||||
[THEME_STORAGE_KEY, theme]
|
||||
)
|
||||
|
||||
for (const route of routes) {
|
||||
const path = route.isCatchAll ? '/this-page-does-not-exist' : route.path
|
||||
const page = await context.newPage()
|
||||
await page.goto(`${origin}/#${path}`, { waitUntil: 'load' })
|
||||
await page.waitForFunction(() => {
|
||||
const main = document.querySelector('#main-content')
|
||||
return Boolean(main && main.textContent && main.textContent.trim().length > 0)
|
||||
}, { timeout: 15000 })
|
||||
await page.waitForTimeout(120)
|
||||
|
||||
const applied = await page.evaluate(() => ({
|
||||
rootClass: document.documentElement.className,
|
||||
stored: (() => { try { return window.localStorage.getItem('beat-theme') } catch { return null } })()
|
||||
}))
|
||||
const appliedTheme = applied.rootClass.split(/\s+/).includes('dark') ? 'dark' : 'light'
|
||||
if (appliedTheme !== theme) {
|
||||
throw new Error(`theme mismatch on ${path} at ${viewport.name}px: the page applied "${appliedTheme}" but "${theme}" was requested`)
|
||||
}
|
||||
|
||||
const checks = await page.evaluate(PAGE_CHECKS)
|
||||
const resting = await readRestingStyles(page)
|
||||
const stops = await walkFocus(page)
|
||||
|
||||
// On small screens the navigation lives behind a menu button. The
|
||||
// menu is opened with the keyboard, the links inside it are walked
|
||||
// as well, and the menu is closed again with Escape.
|
||||
const menu = await openMenuWithKeyboard(page)
|
||||
const menuChecks = menu.opened ? await page.evaluate(() => {
|
||||
window.__a11yScope = '#site-menu'
|
||||
return null
|
||||
}).then(async () => await page.evaluate(PAGE_CHECKS)) : null
|
||||
const menuStops = menu.opened ? await walkFocus(page, { withinMenu: true }) : []
|
||||
if (menu.opened) await page.keyboard.press('Escape')
|
||||
await page.waitForTimeout(80)
|
||||
const menuClosed = await page.evaluate(() => {
|
||||
const button = document.querySelector('button[aria-controls="site-menu"]')
|
||||
const menu = document.querySelector('#site-menu')
|
||||
return {
|
||||
menuPresent: menu !== null,
|
||||
expanded: button?.getAttribute('aria-expanded') ?? null,
|
||||
focusOnButton: document.activeElement === button
|
||||
}
|
||||
})
|
||||
|
||||
const entry = {
|
||||
theme,
|
||||
width: viewport.width,
|
||||
widthName: viewport.name,
|
||||
path,
|
||||
routeName: route.name,
|
||||
routeTitle: route.title,
|
||||
appliedTheme,
|
||||
landmarks: checks.landmarks,
|
||||
landmarkCounts: checks.landmarkCounts,
|
||||
headings: checks.headings,
|
||||
h1Count: checks.h1Count,
|
||||
headingSkips: checks.headingSkips,
|
||||
links: checks.links,
|
||||
images: checks.images,
|
||||
contrast: checks.contrast,
|
||||
interactive: checks.interactive,
|
||||
focusStops: stops,
|
||||
restingStyles: resting,
|
||||
menu: menu.opened
|
||||
? {
|
||||
opened: true,
|
||||
landmarks: menuChecks.landmarks,
|
||||
landmarkCounts: menuChecks.landmarkCounts,
|
||||
headings: menuChecks.headings,
|
||||
links: menuChecks.links,
|
||||
images: menuChecks.images,
|
||||
contrast: menuChecks.contrast,
|
||||
interactive: menuChecks.interactive,
|
||||
focusStops: menuStops,
|
||||
closed: menuClosed
|
||||
}
|
||||
: { opened: false, reason: menu.reason }
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------- the verdicts */
|
||||
|
||||
const problems = []
|
||||
|
||||
if (checks.landmarkCounts.banner !== 1) problems.push(`banner landmarks: ${checks.landmarkCounts.banner} (expected 1)`)
|
||||
if (checks.landmarkCounts.main !== 1) problems.push(`main landmarks: ${checks.landmarkCounts.main} (expected 1)`)
|
||||
if (checks.landmarkCounts.contentinfo !== 1) problems.push(`contentinfo landmarks: ${checks.landmarkCounts.contentinfo} (expected 1)`)
|
||||
if (checks.landmarkCounts.navigation < 1) problems.push('no navigation landmark')
|
||||
if (checks.h1Count !== 1) problems.push(`h1 headings: ${checks.h1Count} (expected 1)`)
|
||||
if (checks.headingSkips.length > 0) {
|
||||
problems.push(`heading level skipped: ${checks.headingSkips.map((skip) => `h${skip.from} to h${skip.to} ("${skip.text}")`).join('; ')}`)
|
||||
}
|
||||
|
||||
const meaninglessLinks = checks.links.filter((link) => {
|
||||
const name = link.name.toLowerCase().replace(/[.!:,]+$/, '')
|
||||
if (name === '') return true
|
||||
// A bare URL is a bad link name, unless it sits in a reference
|
||||
// entry that names the work it links to.
|
||||
if (/^https?:\/\//.test(name)) return !link.labelledEntry
|
||||
return MEANINGLESS_LINK_NAMES.includes(name)
|
||||
})
|
||||
for (const link of meaninglessLinks) {
|
||||
problems.push(`link text "${link.name}" does not describe its destination (${link.href})`)
|
||||
}
|
||||
|
||||
const imagesWithoutAlt = checks.images.filter((image) => !image.hasAlt && !image.ariaHidden)
|
||||
for (const image of imagesWithoutAlt) {
|
||||
problems.push(`image without alt text: ${image.src}`)
|
||||
}
|
||||
const informativeWithoutText = checks.images.filter((image) => image.hasAlt && image.alt.trim() === '' && !image.ariaHidden && image.src !== 'inline <svg>')
|
||||
for (const image of informativeWithoutText) {
|
||||
problems.push(`image with empty alt but no aria-hidden: ${image.src}`)
|
||||
}
|
||||
|
||||
const contrastFailures = checks.contrast.filter((measurement) => !measurement.passes)
|
||||
for (const measurement of contrastFailures) {
|
||||
problems.push(`contrast ${measurement.ratio}:1 (needs ${measurement.required}:1) on ${measurement.tag}.${measurement.className} "${measurement.text}"`)
|
||||
}
|
||||
|
||||
// Every interactive element must be reachable with Tab. Radios
|
||||
// that share a name form one group and therefore one tab stop, so
|
||||
// the group is checked once.
|
||||
const reachable = new Set(stops.map((stop) => stop.id))
|
||||
const unreachable = checks.interactive.filter((element) => {
|
||||
if (reachable.has(element.id)) return false
|
||||
if (element.radioGroup !== null) {
|
||||
return !checks.interactive.some((other) => other.radioGroup === element.radioGroup && reachable.has(other.id))
|
||||
}
|
||||
return true
|
||||
})
|
||||
if (unreachable.length > 0) {
|
||||
problems.push(`${unreachable.length} interactive element(s) not reachable with Tab: ${unreachable.map((element) => element.tag + ' "' + element.text + '"').join(', ')}`)
|
||||
}
|
||||
|
||||
// The focus order must follow the order the elements appear in.
|
||||
// The order in the document is the order a screen-reader user
|
||||
// meets them, so a stop that comes before its predecessor in the
|
||||
// document is a wrong order.
|
||||
const orderBreaks = []
|
||||
for (let index = 1; index < stops.length; index++) {
|
||||
const previous = stops[index - 1]
|
||||
const current = stops[index]
|
||||
if (previous.domIndex >= 0 && current.domIndex >= 0 && current.domIndex < previous.domIndex) {
|
||||
orderBreaks.push(`${previous.tag} "${previous.text}" before ${current.tag} "${current.text}"`)
|
||||
}
|
||||
}
|
||||
if (orderBreaks.length > 0) {
|
||||
problems.push(`focus order does not follow the document order: ${orderBreaks.join('; ')}`)
|
||||
}
|
||||
|
||||
// The focus indicator must be visible: an outline that is drawn, or
|
||||
// a ring or a border change against the resting state.
|
||||
const restingById = new Map(resting.map((element) => [element.id, element]))
|
||||
const withoutIndicator = []
|
||||
for (const stop of stops) {
|
||||
const before = restingById.get(stop.id)
|
||||
const outlineWidth = Number.parseFloat(stop.outlineWidth) || 0
|
||||
const outlineDrawn = stop.outlineStyle !== 'none' && outlineWidth > 0
|
||||
const shadowChanged = before !== undefined && stop.boxShadow !== before.boxShadow && stop.boxShadow !== 'none'
|
||||
const borderChanged = before !== undefined && stop.borderColor !== before.borderColor
|
||||
if (!outlineDrawn && !shadowChanged && !borderChanged) {
|
||||
withoutIndicator.push(`${stop.tag} "${stop.text}" (outline ${stop.outlineStyle} ${stop.outlineWidth})`)
|
||||
}
|
||||
}
|
||||
if (withoutIndicator.length > 0) {
|
||||
problems.push(`${withoutIndicator.length} focus stop(s) without a visible focus indicator: ${withoutIndicator.join('; ')}`)
|
||||
}
|
||||
|
||||
// The menu behind the button, when the page has one, must open
|
||||
// with the keyboard, hold the same landmarks, and close again.
|
||||
if (entry.menu.opened) {
|
||||
if (entry.menu.landmarkCounts.main !== 1) problems.push(`menu: main landmarks ${entry.menu.landmarkCounts.main} (expected 1)`)
|
||||
if (entry.menu.landmarkCounts.banner !== 1) problems.push(`menu: banner landmarks ${entry.menu.landmarkCounts.banner} (expected 1)`)
|
||||
if (entry.menu.closed.menuPresent) problems.push('menu: the menu did not close when Escape was pressed')
|
||||
if (entry.menu.closed.expanded !== 'false') problems.push(`menu: aria-expanded is "${entry.menu.closed.expanded}" after closing (expected "false")`)
|
||||
if (!entry.menu.closed.focusOnButton) problems.push('menu: focus did not return to the menu button after closing')
|
||||
|
||||
const menuReachable = new Set(entry.menu.focusStops.map((stop) => stop.id))
|
||||
const menuUnreachable = entry.menu.interactive.filter((element) => {
|
||||
if (menuReachable.has(element.id)) return false
|
||||
if (element.radioGroup !== null) {
|
||||
return !entry.menu.interactive.some((other) => other.radioGroup === element.radioGroup && menuReachable.has(other.id))
|
||||
}
|
||||
return true
|
||||
})
|
||||
if (menuUnreachable.length > 0) {
|
||||
problems.push(`menu: ${menuUnreachable.length} interactive element(s) not reachable with Tab: ${menuUnreachable.map((element) => element.tag + ' "' + element.text + '"').join(', ')}`)
|
||||
}
|
||||
|
||||
const menuOrderBreaks = []
|
||||
for (let index = 1; index < entry.menu.focusStops.length; index++) {
|
||||
const previous = entry.menu.focusStops[index - 1]
|
||||
const current = entry.menu.focusStops[index]
|
||||
if (previous.domIndex >= 0 && current.domIndex >= 0 && current.domIndex < previous.domIndex) {
|
||||
menuOrderBreaks.push(`${previous.tag} "${previous.text}" before ${current.tag} "${current.text}"`)
|
||||
}
|
||||
}
|
||||
if (menuOrderBreaks.length > 0) {
|
||||
problems.push(`menu: focus order does not follow the document order: ${menuOrderBreaks.join('; ')}`)
|
||||
}
|
||||
}
|
||||
|
||||
entry.problems = problems
|
||||
entry.pass = problems.length === 0
|
||||
report.routes.push(entry)
|
||||
|
||||
for (const problem of problems) {
|
||||
report.failures.push({ theme, width: viewport.width, path, problem })
|
||||
}
|
||||
|
||||
process.stderr.write(`checked ${theme} ${viewport.name}px ${path} -> ${entry.pass ? 'pass' : `${problems.length} problem(s)`}\n`)
|
||||
await page.close()
|
||||
}
|
||||
|
||||
await context.close()
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
await browser.close()
|
||||
server.close()
|
||||
}
|
||||
|
||||
if (options.json !== null) writeFileSync(options.json, JSON.stringify(report, null, 2))
|
||||
|
||||
printReport(report)
|
||||
return report.failures.length === 0 ? 0 : 1
|
||||
}
|
||||
|
||||
function printReport (report) {
|
||||
console.log('')
|
||||
console.log('='.repeat(78))
|
||||
console.log('check-a11y-manual: per-route manual check results')
|
||||
console.log('='.repeat(78))
|
||||
|
||||
for (const entry of report.routes) {
|
||||
console.log('')
|
||||
console.log(`--- ${entry.theme} ${entry.widthName}px ${entry.path} ---`)
|
||||
console.log(`title: ${entry.routeTitle ?? '(none)'}`)
|
||||
console.log(`landmarks: banner ${entry.landmarkCounts.banner} | navigation ${entry.landmarkCounts.navigation} | main ${entry.landmarkCounts.main} | contentinfo ${entry.landmarkCounts.contentinfo} | complementary ${entry.landmarkCounts.complementary}`)
|
||||
console.log(`headings: ${entry.headings.length} total, ${entry.h1Count} h1, ${entry.headingSkips.length} skipped level(s)`)
|
||||
for (const heading of entry.headings) {
|
||||
console.log(` h${heading.level} ${heading.text}`)
|
||||
}
|
||||
console.log(`links: ${entry.links.length}`)
|
||||
for (const link of entry.links) {
|
||||
console.log(` "${link.name}" -> ${link.href}`)
|
||||
}
|
||||
console.log(`images: ${entry.images.length}`)
|
||||
for (const image of entry.images) {
|
||||
console.log(` ${image.src} alt=${JSON.stringify(image.alt)}${image.ariaHidden ? ' aria-hidden' : ''}`)
|
||||
}
|
||||
console.log(`focus stops: ${entry.focusStops.length}`)
|
||||
for (const stop of entry.focusStops) {
|
||||
console.log(` ${stop.tag} "${stop.text}" outline=${stop.outlineStyle} ${stop.outlineWidth} ${stop.outlineColor} shadow=${stop.boxShadow === 'none' ? 'none' : 'set'}`)
|
||||
}
|
||||
console.log(`contrast measurements: ${entry.contrast.length} (${entry.contrast.filter((m) => m.passes).length} pass, ${entry.contrast.filter((m) => !m.passes).length} fail)`)
|
||||
for (const measurement of entry.contrast) {
|
||||
console.log(` ${measurement.passes ? 'pass' : 'FAIL'} ${measurement.ratio}:1 (needs ${measurement.required}:1) ${measurement.tag}.${measurement.className} "${measurement.text}" ${measurement.color} on ${measurement.background} ${measurement.fontSize}px/${measurement.fontWeight}${measurement.isLarge ? ' large' : ''}`)
|
||||
}
|
||||
if (entry.problems.length > 0) {
|
||||
console.log(`problems: ${entry.problems.length}`)
|
||||
for (const problem of entry.problems) console.log(` - ${problem}`)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('')
|
||||
console.log('='.repeat(78))
|
||||
console.log(`check-a11y-manual: ${report.routes.length} route/width/theme combination(s), ${report.routes.length - report.failures.length} clean, ${report.failures.length} problem(s)`)
|
||||
for (const failure of report.failures) {
|
||||
console.log(` ${failure.theme} ${failure.width}px ${failure.path}: ${failure.problem}`)
|
||||
}
|
||||
console.log('')
|
||||
}
|
||||
|
||||
try {
|
||||
process.exit(await main(process.argv.slice(2)))
|
||||
} catch (error) {
|
||||
console.error(`check-a11y-manual: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exit(2)
|
||||
}
|
||||
Executable
+624
@@ -0,0 +1,624 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* check-a11y.mjs
|
||||
*
|
||||
* Plain Node script (no test framework) that runs an axe-core scan over
|
||||
* every route of the BEAT site, at a mobile width and a desktop width, in the
|
||||
* light theme and in the dark theme.
|
||||
*
|
||||
* The scan runs against the built site in public/dist, served over HTTP by a
|
||||
* small built-in static server, because that is what the GitHub Pages
|
||||
* workflow publishes. The app uses Vue Router hash history, so a route
|
||||
* reaches the browser as the page URL plus a fragment:
|
||||
*
|
||||
* http://127.0.0.1:<port>/#<route-path>
|
||||
*
|
||||
* The route list is read out of the router config (public/src/router/index.js)
|
||||
* at run time, so a route added to the router later is picked up without
|
||||
* editing this script. The aliases of a route are scanned too: an alias
|
||||
* renders the same page and a published URL, so it must reach the same
|
||||
* verdict.
|
||||
*
|
||||
* The theme is driven through the site's own storage key (beat-theme) and
|
||||
* the prefers-color-scheme media query, so the site applies the theme the way
|
||||
* a reader does. The script asserts the applied theme on every page before
|
||||
* it scans, so a scan can never be reported against the wrong theme.
|
||||
*
|
||||
* axe-core is loaded from the installed package (public/node_modules/axe-core)
|
||||
* into the page, so the scan needs no network access and no vendored copy.
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-a11y.mjs [--dist <dir>] [--router <file>]
|
||||
* [--json] [--help]
|
||||
*
|
||||
* Options:
|
||||
* --dist <dir> built site to scan (default: public/dist)
|
||||
* --router <file> router config to read the route list from
|
||||
* (default: public/src/router/index.js)
|
||||
* --json print the results as JSON instead of a table
|
||||
* --help print this text
|
||||
*
|
||||
* Exit codes: 0 = no serious or critical violation and no unfixed moderate
|
||||
* violation, 1 = at least one such violation, 2 = usage or I/O error.
|
||||
*/
|
||||
|
||||
import { createServer } from 'node:http'
|
||||
import { existsSync, readFileSync, statSync } from 'node:fs'
|
||||
import { createRequire } from 'node:module'
|
||||
import { dirname, extname, join, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import vm from 'node:vm'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
const DEFAULT_DIST = join(REPO_ROOT, 'public', 'dist')
|
||||
const DEFAULT_ROUTER = join(REPO_ROOT, 'public', 'src', 'router', 'index.js')
|
||||
const AXE_PATH = join(REPO_ROOT, 'public', 'node_modules', 'axe-core', 'axe.min.js')
|
||||
|
||||
/** The site's own package holds the devDependencies, so they resolve there. */
|
||||
const SITE_REQUIRE = createRequire(join(REPO_ROOT, 'public', 'package.json'))
|
||||
|
||||
/** The viewports the brief names: a mobile width and a desktop width. */
|
||||
const WIDTHS = [
|
||||
{ name: '360', width: 360, height: 800 },
|
||||
{ name: '1440', width: 1440, height: 900 },
|
||||
]
|
||||
|
||||
/** The two themes. The name is also the value stored under beat-theme. */
|
||||
const THEMES = ['light', 'dark']
|
||||
|
||||
/** The storage key the site's own theme helper reads. */
|
||||
const THEME_STORAGE_KEY = 'beat-theme'
|
||||
|
||||
/**
|
||||
* The WCAG A and AA rule sets axe-core ships: WCAG 2.0, 2.1 and 2.2.
|
||||
* The A level rules are included as well, because a failure there is a
|
||||
* failure of a criterion the AA level inherits.
|
||||
*/
|
||||
const TAGS = ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa']
|
||||
|
||||
/** Impact levels that fail the check. */
|
||||
const FAILING_IMPACTS = ['serious', 'critical']
|
||||
|
||||
/** Moderate violations fail the check unless they are marked as fixed. */
|
||||
const FAILING_MODERATE = 'moderate'
|
||||
|
||||
const usage = `Usage: node scripts/check-a11y.mjs [options]
|
||||
|
||||
--dist <dir> built site to scan (default: public/dist)
|
||||
--router <file> router config to read the route list from
|
||||
--browser <path> Chromium executable to drive
|
||||
--json print the results as JSON instead of a table
|
||||
--help print this text
|
||||
Exit codes: 0 = no serious or critical and no unfixed moderate violation,
|
||||
1 = at least one such violation, 2 = usage or I/O error.`
|
||||
|
||||
/* ------------------------------------------------------------------ options */
|
||||
|
||||
function readOptions (argv) {
|
||||
const flags = new Map([['--help', 'help'], ['-h', 'help'], ['--json', 'json']])
|
||||
const takesValue = new Map([['--dist', 'dist'], ['--router', 'router'], ['--browser', 'browser']])
|
||||
const options = { dist: DEFAULT_DIST, router: DEFAULT_ROUTER, browser: null, json: false, help: false }
|
||||
|
||||
for (let index = 0; index < argv.length; index++) {
|
||||
const argument = argv[index]
|
||||
if (argument.startsWith('-')) {
|
||||
const flag = flags.get(argument)
|
||||
if (flag !== undefined) {
|
||||
options[flag] = true
|
||||
continue
|
||||
}
|
||||
const key = takesValue.get(argument)
|
||||
if (key === undefined) throw new Error(`unknown option: ${argument}`)
|
||||
const value = argv[index + 1]
|
||||
if (value === undefined) throw new Error(`option ${argument} needs a value`)
|
||||
options[key] = resolve(value)
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
throw new Error(`unexpected argument: ${argument}`)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- route table */
|
||||
|
||||
/** Index of the bracket that closes the one at `start`, skipping strings. */
|
||||
function matchingBracket (source, start) {
|
||||
const pairs = { '[': ']', '{': '}', '(': ')' }
|
||||
const open = source[start]
|
||||
const close = pairs[open]
|
||||
if (close === undefined) return -1
|
||||
|
||||
let depth = 0
|
||||
let index = start
|
||||
let state = 'code'
|
||||
while (index < source.length) {
|
||||
const character = source[index]
|
||||
const next = source[index + 1]
|
||||
if (state === 'code') {
|
||||
if (character === '/' && next === '/') { state = 'line'; index += 2; continue }
|
||||
if (character === '/' && next === '*') { state = 'block'; index += 2; continue }
|
||||
if (character === '"') { state = 'double'; index += 1; continue }
|
||||
if (character === "'") { state = 'single'; index += 1; continue }
|
||||
if (character === '`') { state = 'template'; index += 1; continue }
|
||||
if (character === open) depth += 1
|
||||
else if (character === close) {
|
||||
depth -= 1
|
||||
if (depth === 0) return index
|
||||
}
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (state === 'line') {
|
||||
if (character === '\n') state = 'code'
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (state === 'block') {
|
||||
if (character === '*' && next === '/') state = 'code'
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (character === '\\') { index += 2; continue }
|
||||
if ((state === 'single' && character === "'") ||
|
||||
(state === 'double' && character === '"') ||
|
||||
(state === 'template' && character === '`')) state = 'code'
|
||||
index += 1
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
/** Normalize a path: leading slash, no query, no fragment, no trailing slash. */
|
||||
function normalizePath (value) {
|
||||
if (typeof value !== 'string') return null
|
||||
let path = value.trim()
|
||||
if (path === '') return null
|
||||
if (!path.startsWith('/')) path = `/${path}`
|
||||
const cut = path.search(/[?#]/)
|
||||
if (cut !== -1) path = path.slice(0, cut)
|
||||
if (path.length > 1) path = path.replace(/\/+$/, '')
|
||||
return path
|
||||
}
|
||||
|
||||
/**
|
||||
* The route table of the router file, read as data.
|
||||
*
|
||||
* The file is a Vue module that imports vue-router and its view components,
|
||||
* so it is never imported or executed: only the route table literal is
|
||||
* evaluated, and the view components are never called.
|
||||
*/
|
||||
function readRouterRoutes (routerPath) {
|
||||
const source = readFileSync(routerPath, 'utf8')
|
||||
const declaration = /(?:export\s+)?const\s+routes\s*=\s*/.exec(source)
|
||||
if (declaration === null) throw new Error(`no "const routes = ..." in ${routerPath}`)
|
||||
const start = source.indexOf('[', declaration.index + declaration[0].length)
|
||||
if (start === -1) throw new Error(`the routes export in ${routerPath} is not an array literal`)
|
||||
const end = matchingBracket(source, start)
|
||||
if (end === -1) throw new Error(`the routes array in ${routerPath} is not closed`)
|
||||
const literal = source.slice(start, end + 1)
|
||||
|
||||
const routes = vm.runInNewContext(`(${literal})`, Object.create(null), {
|
||||
importModuleDynamically: (specifier) => {
|
||||
throw new Error(`the router file must not be executed, but it imports ${specifier}`)
|
||||
}
|
||||
})
|
||||
if (!Array.isArray(routes)) throw new Error(`the routes export in ${routerPath} is not an array`)
|
||||
|
||||
const entries = []
|
||||
for (const route of routes) {
|
||||
const path = normalizePath(route.path)
|
||||
if (path === null) continue
|
||||
|
||||
const aliases = []
|
||||
if (typeof route.alias === 'string') aliases.push(route.alias)
|
||||
else if (Array.isArray(route.alias)) {
|
||||
for (const alias of route.alias) if (typeof alias === 'string') aliases.push(alias)
|
||||
} else if (route.alias && typeof route.alias === 'object' && typeof route.alias.path === 'string') {
|
||||
aliases.push(route.alias.path)
|
||||
}
|
||||
|
||||
// A catch-all renders the not-found page for every unknown path. It is a
|
||||
// page of the site, so it is scanned at its own sample path.
|
||||
const isCatchAll = path.includes('*')
|
||||
|
||||
entries.push({
|
||||
path,
|
||||
name: typeof route.name === 'string' ? route.name : null,
|
||||
title: route.meta && typeof route.meta.title === 'string' ? route.meta.title : null,
|
||||
aliases: aliases.map(normalizePath).filter((alias) => alias !== null),
|
||||
isCatchAll,
|
||||
})
|
||||
}
|
||||
return entries
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------- static server */
|
||||
|
||||
const MIME_TYPES = {
|
||||
'.html': 'text/html; charset=utf-8',
|
||||
'.js': 'text/javascript; charset=utf-8',
|
||||
'.mjs': 'text/javascript; charset=utf-8',
|
||||
'.css': 'text/css; charset=utf-8',
|
||||
'.json': 'application/json; charset=utf-8',
|
||||
'.svg': 'image/svg+xml',
|
||||
'.png': 'image/png',
|
||||
'.jpg': 'image/jpeg',
|
||||
'.jpeg': 'image/jpeg',
|
||||
'.gif': 'image/gif',
|
||||
'.webp': 'image/webp',
|
||||
'.ico': 'image/x-icon',
|
||||
'.woff': 'font/woff',
|
||||
'.woff2': 'font/woff2',
|
||||
'.ttf': 'font/ttf',
|
||||
'.txt': 'text/plain; charset=utf-8',
|
||||
'.map': 'application/json; charset=utf-8',
|
||||
}
|
||||
|
||||
/**
|
||||
* Serve the built site over HTTP.
|
||||
*
|
||||
* The site uses hash history, so every route is requested as the index
|
||||
* document with a fragment. A missing path still answers with the app shell,
|
||||
* which is what the 404.html fallback does on the Pages host.
|
||||
*/
|
||||
function startServer (distDir) {
|
||||
const server = createServer((request, response) => {
|
||||
const requested = decodeURIComponent((request.url ?? '/').split('?')[0].split('#')[0])
|
||||
const relative = requested.replace(/^\/+/, '')
|
||||
const candidate = relative === '' ? 'index.html' : relative
|
||||
|
||||
let filePath = join(distDir, candidate)
|
||||
if (!existsSync(filePath) || !statSync(filePath).isFile()) {
|
||||
const fallback = join(distDir, '404.html')
|
||||
if (existsSync(fallback)) filePath = fallback
|
||||
else filePath = join(distDir, 'index.html')
|
||||
}
|
||||
|
||||
const type = MIME_TYPES[extname(filePath).toLowerCase()] ?? 'application/octet-stream'
|
||||
const body = readFileSync(filePath)
|
||||
response.writeHead(200, { 'Content-Type': type, 'Content-Length': body.length })
|
||||
response.end(body)
|
||||
})
|
||||
|
||||
return new Promise((resolveServer, rejectServer) => {
|
||||
server.on('error', rejectServer)
|
||||
server.listen(0, '127.0.0.1', () => {
|
||||
const address = server.address()
|
||||
resolveServer({ server, origin: `http://127.0.0.1:${address.port}` })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- the scan */
|
||||
|
||||
/**
|
||||
* Run axe-core over one page and return the raw result.
|
||||
*
|
||||
* The result is the axe-core result object, untouched apart from the nodes
|
||||
* that carry the extra fields the script adds.
|
||||
*/
|
||||
async function scanPage (context, url, axeSource) {
|
||||
const page = await context.newPage()
|
||||
const consoleErrors = []
|
||||
page.on('console', (message) => {
|
||||
if (message.type() === 'error') consoleErrors.push(message.text())
|
||||
})
|
||||
page.on('pageerror', (error) => consoleErrors.push(String(error)))
|
||||
|
||||
try {
|
||||
await page.goto(url, { waitUntil: 'load' })
|
||||
// The app mounts after the bundle loads and the route resolves.
|
||||
await page.waitForFunction(() => {
|
||||
const main = document.querySelector('#main-content')
|
||||
return Boolean(main && main.textContent && main.textContent.trim().length > 0)
|
||||
}, { timeout: 15000 })
|
||||
// Let the fonts settle so a measurement is not taken mid-layout.
|
||||
await page.evaluate(() => document.fonts?.ready?.then?.(() => undefined) ?? undefined)
|
||||
await page.waitForTimeout(120)
|
||||
|
||||
const appliedTheme = await page.evaluate(() => ({
|
||||
rootClass: document.documentElement.className,
|
||||
stored: (() => {
|
||||
try { return window.localStorage.getItem('beat-theme') } catch { return null }
|
||||
})(),
|
||||
background: getComputedStyle(document.body).backgroundColor,
|
||||
}))
|
||||
|
||||
await page.addScriptTag({ content: axeSource })
|
||||
const raw = await page.evaluate(async (tags) => {
|
||||
// eslint-disable-next-line no-undef
|
||||
const result = await window.axe.run(document, {
|
||||
runOnly: { type: 'tag', values: tags },
|
||||
resultTypes: ['violations', 'incomplete', 'passes', 'inapplicable'],
|
||||
})
|
||||
return result
|
||||
}, TAGS)
|
||||
|
||||
return { raw, appliedTheme, consoleErrors }
|
||||
} finally {
|
||||
await page.close()
|
||||
}
|
||||
}
|
||||
|
||||
/** The violations of a raw result, with the fields the report needs. */
|
||||
function summarize (raw) {
|
||||
return raw.violations.map((violation) => ({
|
||||
id: violation.id,
|
||||
impact: violation.impact,
|
||||
help: violation.help,
|
||||
helpUrl: violation.helpUrl,
|
||||
tags: violation.tags,
|
||||
nodes: violation.nodes.map((node) => ({
|
||||
impact: node.impact,
|
||||
target: node.target,
|
||||
html: node.html,
|
||||
failureSummary: node.failureSummary,
|
||||
any: node.any.map((check) => ({ id: check.id, message: check.message, data: check.data })),
|
||||
all: node.all.map((check) => ({ id: check.id, message: check.message, data: check.data })),
|
||||
none: node.none.map((check) => ({ id: check.id, message: check.message, data: check.data })),
|
||||
})),
|
||||
}))
|
||||
}
|
||||
|
||||
/** Count the nodes of a result by impact. */
|
||||
function impactCounts (raw) {
|
||||
const counts = { critical: 0, serious: 0, moderate: 0, minor: 0 }
|
||||
for (const violation of raw.violations) {
|
||||
const key = violation.impact ?? 'minor'
|
||||
counts[key] = (counts[key] ?? 0) + violation.nodes.length
|
||||
}
|
||||
return counts
|
||||
}
|
||||
|
||||
/**
|
||||
* The verdict for one scan.
|
||||
*
|
||||
* A serious or critical violation fails the check. A moderate violation
|
||||
* fails the check unless every one of its nodes is marked as fixed by axe
|
||||
* (`failureSummary` contains "Fixes applied"), because an unfixed moderate
|
||||
* violation is exactly what the brief forbids.
|
||||
*/
|
||||
function verdict (raw) {
|
||||
const failures = []
|
||||
for (const violation of raw.violations) {
|
||||
const impact = violation.impact ?? 'minor'
|
||||
if (FAILING_IMPACTS.includes(impact)) {
|
||||
failures.push({ id: violation.id, impact, nodes: violation.nodes.length })
|
||||
continue
|
||||
}
|
||||
if (impact === FAILING_MODERATE) {
|
||||
const unfixed = violation.nodes.filter((node) => {
|
||||
const summary = node.failureSummary ?? ''
|
||||
return !/fix(es|ed)?\s+applied/i.test(summary)
|
||||
})
|
||||
if (unfixed.length > 0) {
|
||||
failures.push({ id: violation.id, impact, nodes: unfixed.length })
|
||||
}
|
||||
}
|
||||
}
|
||||
return { pass: failures.length === 0, failures }
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------- main */
|
||||
|
||||
async function main (argv) {
|
||||
const options = readOptions(argv)
|
||||
if (options.help) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
|
||||
if (!existsSync(options.dist)) {
|
||||
throw new Error(`cannot read the built site: ${options.dist} does not exist. Run "npm run build" in public/ first.`)
|
||||
}
|
||||
if (!existsSync(options.router)) {
|
||||
throw new Error(`cannot read the router config: ${options.router} does not exist.`)
|
||||
}
|
||||
if (!existsSync(AXE_PATH)) {
|
||||
throw new Error(`cannot read axe-core: ${AXE_PATH} does not exist. Run "npm install" in public/ first.`)
|
||||
}
|
||||
|
||||
const routes = readRouterRoutes(options.router)
|
||||
if (routes.length === 0) throw new Error(`the router config ${options.router} lists no route`)
|
||||
|
||||
const axeSource = readFileSync(AXE_PATH, 'utf8')
|
||||
|
||||
const { chromium } = SITE_REQUIRE('playwright-core')
|
||||
const { server, origin } = await startServer(options.dist)
|
||||
const launchOptions = { args: ['--no-sandbox'] }
|
||||
if (options.browser !== null) launchOptions.executablePath = options.browser
|
||||
const browser = await chromium.launch(launchOptions)
|
||||
|
||||
const results = []
|
||||
try {
|
||||
for (const theme of THEMES) {
|
||||
for (const viewport of WIDTHS) {
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: viewport.width, height: viewport.height },
|
||||
colorScheme: theme,
|
||||
deviceScaleFactor: 1,
|
||||
})
|
||||
// The site's own theme helper reads this key and wins over the media
|
||||
// query, so the stored choice and the media query agree.
|
||||
await context.addInitScript(
|
||||
([key, value]) => {
|
||||
try { window.localStorage.setItem(key, value) } catch { /* storage blocked */ }
|
||||
},
|
||||
[THEME_STORAGE_KEY, theme]
|
||||
)
|
||||
|
||||
for (const route of routes) {
|
||||
// The catch-all renders the not-found page; a sample path makes the
|
||||
// request concrete.
|
||||
const path = route.isCatchAll ? '/this-page-does-not-exist' : route.path
|
||||
const url = `${origin}/#${path}`
|
||||
const { raw, appliedTheme, consoleErrors } = await scanPage(context, url, axeSource)
|
||||
|
||||
const dark = appliedTheme.rootClass.split(/\s+/).includes('dark')
|
||||
const applied = dark ? 'dark' : 'light'
|
||||
if (applied !== theme) {
|
||||
throw new Error(`theme mismatch on ${path} at ${viewport.name}px: the page applied "${applied}" but "${theme}" was requested`)
|
||||
}
|
||||
|
||||
const counts = impactCounts(raw)
|
||||
const { pass, failures } = verdict(raw)
|
||||
results.push({
|
||||
theme,
|
||||
width: viewport.width,
|
||||
widthName: viewport.name,
|
||||
path,
|
||||
routeName: route.name,
|
||||
routeTitle: route.title,
|
||||
isCatchAll: route.isCatchAll,
|
||||
isAlias: false,
|
||||
url,
|
||||
appliedTheme: applied,
|
||||
storedTheme: appliedTheme.stored,
|
||||
bodyBackground: appliedTheme.background,
|
||||
consoleErrors,
|
||||
counts,
|
||||
passes: raw.passes?.length ?? 0,
|
||||
incomplete: raw.incomplete?.length ?? 0,
|
||||
inapplicable: raw.inapplicable?.length ?? 0,
|
||||
violations: summarize(raw),
|
||||
pass,
|
||||
failures,
|
||||
raw,
|
||||
})
|
||||
|
||||
process.stderr.write(`scanned ${theme} ${viewport.name}px ${path} -> ${pass ? 'pass' : 'FAIL'}\n`)
|
||||
}
|
||||
|
||||
// The aliases are published URLs that render the same page, so they
|
||||
// are scanned at one width and one theme: the page they render is the
|
||||
// page that was scanned above, so a second full sweep would measure
|
||||
// the same document again.
|
||||
for (const route of routes) {
|
||||
for (const alias of route.aliases) {
|
||||
const url = `${origin}/#${alias}`
|
||||
const { raw, appliedTheme } = await scanPage(context, url, axeSource)
|
||||
const counts = impactCounts(raw)
|
||||
const { pass, failures } = verdict(raw)
|
||||
results.push({
|
||||
theme,
|
||||
width: viewport.width,
|
||||
widthName: viewport.name,
|
||||
path: alias,
|
||||
routeName: route.name,
|
||||
routeTitle: route.title,
|
||||
isCatchAll: false,
|
||||
isAlias: true,
|
||||
url,
|
||||
appliedTheme: appliedTheme.rootClass.split(/\s+/).includes('dark') ? 'dark' : 'light',
|
||||
storedTheme: appliedTheme.stored,
|
||||
bodyBackground: appliedTheme.background,
|
||||
consoleErrors: [],
|
||||
counts,
|
||||
passes: raw.passes?.length ?? 0,
|
||||
incomplete: raw.incomplete?.length ?? 0,
|
||||
inapplicable: raw.inapplicable?.length ?? 0,
|
||||
violations: summarize(raw),
|
||||
pass,
|
||||
failures,
|
||||
raw,
|
||||
})
|
||||
process.stderr.write(`scanned ${theme} ${viewport.name}px ${alias} (alias) -> ${pass ? 'pass' : 'FAIL'}\n`)
|
||||
}
|
||||
}
|
||||
|
||||
await context.close()
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
await browser.close()
|
||||
server.close()
|
||||
}
|
||||
|
||||
const failing = results.filter((result) => !result.pass)
|
||||
|
||||
if (options.json) {
|
||||
console.log(JSON.stringify({ results: results.map(({ raw, ...rest }) => rest) }, null, 2))
|
||||
} else {
|
||||
printReport(results)
|
||||
}
|
||||
|
||||
return failing.length === 0 ? 0 : 1
|
||||
}
|
||||
|
||||
/**
|
||||
* The human-readable report.
|
||||
*
|
||||
* One block per route, width and theme, with the raw scan output for that
|
||||
* combination: every violation with its impact, help text, WCAG tags and
|
||||
* the failing nodes.
|
||||
*/
|
||||
function printReport (results) {
|
||||
const byCombination = new Map()
|
||||
for (const result of results) {
|
||||
const key = `${result.theme} ${result.widthName}`
|
||||
if (!byCombination.has(key)) byCombination.set(key, [])
|
||||
byCombination.get(key).push(result)
|
||||
}
|
||||
|
||||
for (const [combination, group] of byCombination) {
|
||||
console.log('')
|
||||
console.log('='.repeat(78))
|
||||
console.log(`check-a11y: ${combination}px`)
|
||||
console.log('='.repeat(78))
|
||||
for (const result of group) {
|
||||
const label = result.isAlias ? `${result.path} (alias of ${result.routeName})` : result.path
|
||||
console.log('')
|
||||
console.log(`--- route ${label} | theme ${result.theme} | viewport ${result.widthName}px ---`)
|
||||
console.log(`url: ${result.url}`)
|
||||
console.log(`title: ${result.routeTitle ?? '(none)'}`)
|
||||
console.log(`applied theme: ${result.appliedTheme} (stored: ${result.storedTheme})`)
|
||||
console.log(`axe-core passes: ${result.passes} | incomplete: ${result.incomplete} | inapplicable: ${result.inapplicable}`)
|
||||
const counts = result.counts
|
||||
console.log(`violations: critical ${counts.critical ?? 0} | serious ${counts.serious ?? 0} | moderate ${counts.moderate ?? 0} | minor ${counts.minor ?? 0}`)
|
||||
if (result.consoleErrors.length > 0) {
|
||||
console.log(`console errors: ${result.consoleErrors.length}`)
|
||||
for (const error of result.consoleErrors) console.log(` ${error}`)
|
||||
}
|
||||
if (result.violations.length === 0) {
|
||||
console.log('no violations')
|
||||
continue
|
||||
}
|
||||
for (const violation of result.violations) {
|
||||
console.log('')
|
||||
console.log(` [${violation.impact ?? 'unknown'}] ${violation.id}: ${violation.help}`)
|
||||
console.log(` tags: ${violation.tags.join(', ')}`)
|
||||
console.log(` help: ${violation.helpUrl}`)
|
||||
for (const node of violation.nodes) {
|
||||
console.log(` node: ${JSON.stringify(node.target)}`)
|
||||
console.log(` html: ${node.html}`)
|
||||
if (node.failureSummary) {
|
||||
for (const line of node.failureSummary.split('\n')) console.log(` ${line}`)
|
||||
}
|
||||
for (const check of [...node.any, ...node.all, ...node.none]) {
|
||||
console.log(` check ${check.id}: ${check.message}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const failing = results.filter((result) => !result.pass)
|
||||
console.log('')
|
||||
console.log('='.repeat(78))
|
||||
console.log(`check-a11y: ${results.length} scan(s) over ${results.length} route/width/theme combination(s)`)
|
||||
console.log(`check-a11y: ${results.length - failing.length} pass, ${failing.length} fail`)
|
||||
for (const result of failing) {
|
||||
console.log(` FAIL ${result.theme} ${result.widthName}px ${result.path}: ${result.failures.map((failure) => `${failure.impact} ${failure.id} (${failure.nodes} node(s))`).join(', ')}`)
|
||||
}
|
||||
console.log('')
|
||||
}
|
||||
|
||||
try {
|
||||
process.exit(await main(process.argv.slice(2)))
|
||||
} catch (error) {
|
||||
console.error(`check-a11y: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exit(2)
|
||||
}
|
||||
Executable
+400
@@ -0,0 +1,400 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* check-banned-terms.mjs
|
||||
*
|
||||
* Plain Node script (no runtime dependency) that checks copy discipline: no
|
||||
* marketing language in the site copy or in the README headings.
|
||||
*
|
||||
* The banned terms live in a separate data file (scripts/banned-terms.txt by
|
||||
* default) so the list can be tuned without touching this script.
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-banned-terms.mjs [path ...] [--list <file>] [--md-scope headings|all]
|
||||
*
|
||||
* Paths default to README.md and public/src, relative to the repository root.
|
||||
* Exit codes: 0 = no hits, 1 = hits found, 2 = bad usage or I/O error.
|
||||
*
|
||||
* What counts as copy:
|
||||
* - JavaScript and Vue script blocks: the text of string literals. A reader
|
||||
* sees that text; identifiers, object keys and comments are not copy.
|
||||
* - Vue templates: text content and the user-visible attributes title, alt,
|
||||
* label, placeholder and aria-label.
|
||||
* - Markdown: headings only, unless --md-scope all is given.
|
||||
*/
|
||||
|
||||
import { readFileSync, readdirSync, statSync } from 'node:fs'
|
||||
import { dirname, extname, join, relative, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
const DEFAULT_LIST = join(SCRIPT_DIR, 'banned-terms.txt')
|
||||
const DEFAULT_TARGETS = [join(REPO_ROOT, 'README.md'), join(REPO_ROOT, 'public/src')]
|
||||
|
||||
const SKIP_DIRS = new Set(['node_modules', 'dist', '.git', 'coverage', '.vite', '.locust'])
|
||||
const CODE_EXTENSIONS = new Set(['.js', '.mjs', '.cjs', '.ts', '.jsx', '.tsx'])
|
||||
const VUE_EXTENSIONS = new Set(['.vue'])
|
||||
const MARKDOWN_EXTENSIONS = new Set(['.md', '.mdx'])
|
||||
const TEXT_EXTENSIONS = new Set([...CODE_EXTENSIONS, ...VUE_EXTENSIONS, ...MARKDOWN_EXTENSIONS])
|
||||
|
||||
// Attributes of a tag whose value the reader sees.
|
||||
const USER_VISIBLE_ATTRIBUTES = new Set(['title', 'alt', 'label', 'placeholder', 'aria-label'])
|
||||
|
||||
const usage = `Usage: node scripts/check-banned-terms.mjs [path ...] [--list <file>] [--md-scope headings|all]
|
||||
|
||||
Paths default to README.md and public/src (relative to the repository root).
|
||||
--list <file> banned-term list to read (default: scripts/banned-terms.txt)
|
||||
--md-scope headings (default) or all, for Markdown files
|
||||
Exit codes: 0 = no hits, 1 = hits found, 2 = usage or I/O error.`
|
||||
|
||||
/** Read the banned-term list. One term per line, "#" starts a comment. */
|
||||
function readTermList (listPath) {
|
||||
let text
|
||||
try {
|
||||
text = readFileSync(listPath, 'utf8')
|
||||
} catch {
|
||||
throw new Error(`cannot read banned-term list: ${listPath}`)
|
||||
}
|
||||
const terms = []
|
||||
for (const rawLine of text.split('\n')) {
|
||||
const line = rawLine.replace(/\r$/, '').trim()
|
||||
if (line === '' || line.startsWith('#')) continue
|
||||
terms.push(line)
|
||||
}
|
||||
if (terms.length === 0) throw new Error(`banned-term list is empty: ${listPath}`)
|
||||
return terms
|
||||
}
|
||||
|
||||
/** Build the matcher for one term: word boundaries for single words, flexible spacing for phrases. */
|
||||
function buildMatcher (term) {
|
||||
const pattern = term
|
||||
.split(/\s+/)
|
||||
.map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
|
||||
.join('[\\s_-]+')
|
||||
return {
|
||||
term,
|
||||
regex: new RegExp(`(?<![\\p{L}\\p{N}])${pattern}(?![\\p{L}\\p{N}])`, 'giu')
|
||||
}
|
||||
}
|
||||
|
||||
/** Collect the text files under a target path. */
|
||||
function collectFiles (target) {
|
||||
const absolute = resolve(process.cwd(), target)
|
||||
let stats
|
||||
try {
|
||||
stats = statSync(absolute)
|
||||
} catch {
|
||||
throw new Error(`cannot read target: ${target}`)
|
||||
}
|
||||
if (stats.isFile()) return [absolute]
|
||||
const files = []
|
||||
const walk = (dir) => {
|
||||
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
||||
if (entry.isDirectory()) {
|
||||
if (SKIP_DIRS.has(entry.name)) continue
|
||||
walk(join(dir, entry.name))
|
||||
} else if (entry.isFile()) {
|
||||
if (TEXT_EXTENSIONS.has(extname(entry.name))) files.push(join(dir, entry.name))
|
||||
}
|
||||
}
|
||||
}
|
||||
walk(absolute)
|
||||
return files.sort()
|
||||
}
|
||||
|
||||
/**
|
||||
* A string literal that is a locator - a URL, a protocol-relative URL or an
|
||||
* absolute path - points at something, it is not copy the reader reads.
|
||||
*/
|
||||
function isLocator (text) {
|
||||
if (/\s/.test(text)) return false
|
||||
return /^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(text) || text.startsWith('/') || /^mailto:/i.test(text)
|
||||
}
|
||||
|
||||
/** The text of the string literals in a code range, with their absolute offsets. */
|
||||
function codeStrings (text, start, end) {
|
||||
const pieces = []
|
||||
let index = start
|
||||
while (index < end) {
|
||||
const character = text[index]
|
||||
if (character === '/' && text[index + 1] === '/') {
|
||||
while (index < end && text[index] !== '\n') index++
|
||||
continue
|
||||
}
|
||||
if (character === '/' && text[index + 1] === '*') {
|
||||
index += 2
|
||||
while (index < end && !(text[index] === '*' && text[index + 1] === '/')) index++
|
||||
index += 2
|
||||
continue
|
||||
}
|
||||
if (character === '"' || character === "'") {
|
||||
const contentStart = index + 1
|
||||
index++
|
||||
while (index < end) {
|
||||
if (text[index] === '\\') {
|
||||
index += 2
|
||||
continue
|
||||
}
|
||||
if (text[index] === character) break
|
||||
index++
|
||||
}
|
||||
pieces.push({ start: contentStart, text: text.slice(contentStart, index) })
|
||||
index++
|
||||
continue
|
||||
}
|
||||
if (character === '`') {
|
||||
// Template literal: the literal text between the substitutions is copy,
|
||||
// the expressions inside ${...} are code and are skipped.
|
||||
index++
|
||||
let segmentStart = index
|
||||
while (index < end) {
|
||||
if (text[index] === '\\') {
|
||||
index += 2
|
||||
continue
|
||||
}
|
||||
if (text[index] === '`') break
|
||||
if (text[index] === '$' && text[index + 1] === '{') {
|
||||
pieces.push({ start: segmentStart, text: text.slice(segmentStart, index) })
|
||||
index += 2
|
||||
let depth = 1
|
||||
while (index < end && depth > 0) {
|
||||
if (text[index] === '{') depth++
|
||||
else if (text[index] === '}') depth--
|
||||
index++
|
||||
}
|
||||
segmentStart = index
|
||||
continue
|
||||
}
|
||||
index++
|
||||
}
|
||||
pieces.push({ start: segmentStart, text: text.slice(segmentStart, index) })
|
||||
index++
|
||||
continue
|
||||
}
|
||||
index++
|
||||
}
|
||||
return pieces.filter((piece) => piece.text !== '' && !isLocator(piece.text))
|
||||
}
|
||||
|
||||
/** The region of a Vue file's <template> block, or null. */
|
||||
function templateRegion (text) {
|
||||
const open = text.search(/<template(\s[^>]*)?>/i)
|
||||
if (open === -1) return null
|
||||
const openEnd = text.indexOf('>', open) + 1
|
||||
const close = text.lastIndexOf('</template>')
|
||||
if (close === -1 || close < openEnd) return null
|
||||
return { start: openEnd, end: close }
|
||||
}
|
||||
|
||||
/** The region of a Vue file's <script> block, or null. */
|
||||
function scriptRegion (text) {
|
||||
const open = text.search(/<script(\s[^>]*)?>/i)
|
||||
if (open === -1) return null
|
||||
const openEnd = text.indexOf('>', open) + 1
|
||||
const close = text.lastIndexOf('</script>')
|
||||
if (close === -1 || close < openEnd) return null
|
||||
return { start: openEnd, end: close }
|
||||
}
|
||||
|
||||
/** Text content and user-visible attribute values of a template region. */
|
||||
function templateCopy (text, region) {
|
||||
const pieces = []
|
||||
const slice = text.slice(region.start, region.end)
|
||||
const tagRe = /<!--[\s\S]*?-->|<\/?([a-zA-Z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)\/?>/g
|
||||
let last = 0
|
||||
for (const match of slice.matchAll(tagRe)) {
|
||||
// Text between the previous tag and this one is template text content.
|
||||
if (match.index > last) {
|
||||
pieces.push({ start: region.start + last, text: slice.slice(last, match.index) })
|
||||
}
|
||||
last = match.index + match[0].length
|
||||
|
||||
if (match[1] === undefined) continue // an HTML comment is not copy
|
||||
|
||||
const attributeText = match[2] ?? ''
|
||||
const attributeTextOffset = match.index + 1 + match[1].length
|
||||
const attributeRe = /([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g
|
||||
let attribute
|
||||
while ((attribute = attributeRe.exec(attributeText)) !== null) {
|
||||
// A bound attribute (:title, v-bind:title) shows the same value as the
|
||||
// static one, so both are copy.
|
||||
const name = attribute[1].toLowerCase().replace(/^(?:v-bind:|:)/, '')
|
||||
if (!USER_VISIBLE_ATTRIBUTES.has(name)) continue
|
||||
const doubleQuoted = attribute[2] !== undefined
|
||||
const value = doubleQuoted ? attribute[2] : attribute[3]
|
||||
const quoteCharacter = doubleQuoted ? '"' : "'"
|
||||
const equals = attribute[0].indexOf('=')
|
||||
const valueOffset = attribute[0].indexOf(quoteCharacter, equals) + 1
|
||||
pieces.push({
|
||||
start: region.start + attributeTextOffset + attribute.index + valueOffset,
|
||||
text: value
|
||||
})
|
||||
}
|
||||
}
|
||||
if (last < slice.length) {
|
||||
pieces.push({ start: region.start + last, text: slice.slice(last) })
|
||||
}
|
||||
return pieces
|
||||
}
|
||||
|
||||
/** Headings of a Markdown file, with their absolute offsets. */
|
||||
function markdownHeadings (text) {
|
||||
const headings = []
|
||||
let inFence = false
|
||||
const lines = text.split('\n')
|
||||
let offset = 0
|
||||
for (const line of lines) {
|
||||
if (/^\s{0,3}(?:```|~~~)/.test(line)) {
|
||||
inFence = !inFence
|
||||
offset += line.length + 1
|
||||
continue
|
||||
}
|
||||
if (!inFence) {
|
||||
const match = line.match(/^ {0,3}#{1,6}[ \t]+(.+)$/)
|
||||
if (match) {
|
||||
const inline = match[1]
|
||||
.replace(/!?\[([^\]]*)\]\([^)]*\)/g, '$1')
|
||||
.replace(/[*_`~]/g, '')
|
||||
headings.push({ start: offset, text: inline })
|
||||
}
|
||||
}
|
||||
offset += line.length + 1
|
||||
}
|
||||
return headings
|
||||
}
|
||||
|
||||
/** Every piece of copy in a file, with absolute offsets. */
|
||||
function extractCopy (text, extension, mdScope) {
|
||||
const pieces = []
|
||||
if (MARKDOWN_EXTENSIONS.has(extension)) {
|
||||
if (mdScope === 'all') {
|
||||
pieces.push({ start: 0, text })
|
||||
} else {
|
||||
pieces.push(...markdownHeadings(text))
|
||||
}
|
||||
return pieces
|
||||
}
|
||||
if (CODE_EXTENSIONS.has(extension)) {
|
||||
pieces.push(...codeStrings(text, 0, text.length))
|
||||
return pieces
|
||||
}
|
||||
if (VUE_EXTENSIONS.has(extension)) {
|
||||
const script = scriptRegion(text)
|
||||
if (script) pieces.push(...codeStrings(text, script.start, script.end))
|
||||
const template = templateRegion(text)
|
||||
if (template) pieces.push(...templateCopy(text, template))
|
||||
return pieces
|
||||
}
|
||||
return pieces
|
||||
}
|
||||
|
||||
/** Line/column lookup for an offset inside a text buffer. */
|
||||
function makeLocator (text) {
|
||||
const lineStarts = [0]
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
if (text[i] === '\n') lineStarts.push(i + 1)
|
||||
}
|
||||
return (offset) => {
|
||||
let low = 0
|
||||
let high = lineStarts.length - 1
|
||||
while (low < high) {
|
||||
const mid = (low + high + 1) >> 1
|
||||
if (lineStarts[mid] <= offset) low = mid
|
||||
else high = mid - 1
|
||||
}
|
||||
return { line: low + 1, column: offset - lineStarts[low] + 1 }
|
||||
}
|
||||
}
|
||||
|
||||
function main (argv) {
|
||||
if (argv.includes('--help') || argv.includes('-h')) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
|
||||
let listPath = DEFAULT_LIST
|
||||
let mdScope = 'headings'
|
||||
const paths = []
|
||||
for (let i = 0; i < argv.length; i++) {
|
||||
const argument = argv[i]
|
||||
if (argument === '--list') {
|
||||
listPath = resolve(process.cwd(), argv[++i] ?? '')
|
||||
} else if (argument.startsWith('--list=')) {
|
||||
listPath = resolve(process.cwd(), argument.slice('--list='.length))
|
||||
} else if (argument === '--md-scope') {
|
||||
mdScope = argv[++i] ?? 'headings'
|
||||
} else if (argument.startsWith('--md-scope=')) {
|
||||
mdScope = argument.slice('--md-scope='.length)
|
||||
} else if (argument.startsWith('-')) {
|
||||
throw new Error(`unknown option: ${argument}`)
|
||||
} else {
|
||||
paths.push(argument)
|
||||
}
|
||||
}
|
||||
if (mdScope !== 'headings' && mdScope !== 'all') {
|
||||
throw new Error('--md-scope must be "headings" or "all"')
|
||||
}
|
||||
|
||||
const targets = paths.length > 0 ? paths : DEFAULT_TARGETS
|
||||
const terms = readTermList(listPath).map(buildMatcher)
|
||||
|
||||
const files = []
|
||||
for (const target of targets) {
|
||||
for (const file of collectFiles(target)) {
|
||||
if (!files.includes(file)) files.push(file)
|
||||
}
|
||||
}
|
||||
files.sort()
|
||||
|
||||
const hits = []
|
||||
for (const file of files) {
|
||||
const text = readFileSync(file, 'utf8')
|
||||
if (text.includes('\u0000')) continue
|
||||
const extension = extname(file)
|
||||
const locator = makeLocator(text)
|
||||
for (const piece of extractCopy(text, extension, mdScope)) {
|
||||
for (const matcher of terms) {
|
||||
matcher.regex.lastIndex = 0
|
||||
for (const match of piece.text.matchAll(matcher.regex)) {
|
||||
const offset = piece.start + match.index
|
||||
const { line, column } = locator(offset)
|
||||
hits.push({ file, line, column, term: matcher.term, matched: match[0] })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const shown = (file) => relative(process.cwd(), file) || file
|
||||
console.log(
|
||||
`check-banned-terms: ${files.length} file(s) scanned across ${targets.length} target(s), ` +
|
||||
`${terms.length} banned term(s) from ${shown(listPath)} (md-scope: ${mdScope})`
|
||||
)
|
||||
for (const hit of hits) {
|
||||
console.log(
|
||||
`${shown(hit.file)}:${hit.line}:${hit.column}: ` +
|
||||
`[banned-term] "${hit.matched}" (list entry: ${hit.term})`
|
||||
)
|
||||
}
|
||||
|
||||
const byTerm = new Map()
|
||||
for (const hit of hits) byTerm.set(hit.term, (byTerm.get(hit.term) ?? 0) + 1)
|
||||
const byFile = new Map()
|
||||
for (const hit of hits) {
|
||||
const name = shown(hit.file)
|
||||
byFile.set(name, (byFile.get(name) ?? 0) + 1)
|
||||
}
|
||||
|
||||
console.log(`${hits.length} hit(s) in ${byFile.size} file(s)`)
|
||||
for (const [term, count] of [...byTerm.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))) {
|
||||
console.log(` ${term}: ${count}`)
|
||||
}
|
||||
return hits.length > 0 ? 1 : 0
|
||||
}
|
||||
|
||||
try {
|
||||
process.exit(main(process.argv.slice(2)))
|
||||
} catch (error) {
|
||||
console.error(`check-banned-terms: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exit(2)
|
||||
}
|
||||
Executable
+396
@@ -0,0 +1,396 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* check-citations.mjs
|
||||
*
|
||||
* Plain Node script (no dependency, no test framework) that proves every
|
||||
* research claim and figure in README.md and in public/src/data carries a
|
||||
* resolvable inline citation, and that every inline citation resolves on
|
||||
* both mirrors.
|
||||
*
|
||||
* The citation scheme (settled by the methodology lead): a bracketed named id,
|
||||
* the same ids on both mirrors — deci-ryan-2000, mark-2005, desktime-2014,
|
||||
* mit-sloan-2017, rogelberg-2019, slack-workplace-lab-2017. README.md carries
|
||||
* a `## References` section listing every id; public/src/data/references.js
|
||||
* carries the equivalent references structure. Source reachability is NOT
|
||||
* checked: a locator (DOI, ISBN or locator note) present in the entry is
|
||||
* sufficient.
|
||||
*
|
||||
* What counts as a claim or figure here:
|
||||
* - README.md: a content line carrying a digit or research vocabulary
|
||||
* (survey, study, reported, participant, respondent, trial). Structured
|
||||
* lines are carved out and never claims: table rows, fenced code, the
|
||||
* references section itself, the version footer, principle-number titles,
|
||||
* ceremony/duration list items and bold lead-in rule or limit statements
|
||||
* (limits and durations are BEAT defaults, not research findings).
|
||||
* - public/src/data: a prose string value carrying a digit, a percent sign
|
||||
* or research vocabulary. Presentation and structured keys are carved out:
|
||||
* icon, gradient, color, id, citation, stat, value, label, step, name,
|
||||
* title, constraint, limit, rule, range, key, dataKey, heading, over,
|
||||
* valueMore, pattern, category, duration, number. Durations, limits,
|
||||
* option scale labels and score values are structured fields, not claims.
|
||||
*
|
||||
* What resolves a claim: an inline `[id]` marker that resolves to a reference
|
||||
* entry on BOTH sides, or a BEAT-default marker in the same string
|
||||
* ("a BEAT default", "BEAT's own ... not a research finding", "not a measured
|
||||
* threshold").
|
||||
*
|
||||
* The run fails (exit 1) when:
|
||||
* - a claim or figure carries neither an inline citation nor a BEAT-default
|
||||
* marker;
|
||||
* - an inline citation id resolves to no entry in the README references
|
||||
* section or to no entry in the data references structure;
|
||||
* - the two reference sets disagree (an id on only one side);
|
||||
* - a reference entry has no locator (README: DOI, ISBN or locator note;
|
||||
* data: an empty `locator` field);
|
||||
* - a reference entry is never cited (a FAILURE, not a warning: an entry
|
||||
* no claim uses is a defect under this scheme).
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-citations.mjs [--readme <file>] [--manifesto <file>]
|
||||
* [--assessment <file>] [--references <file>]
|
||||
*
|
||||
* Exit codes: 0 = every claim resolves and every citation and reference entry
|
||||
* resolves on both sides,
|
||||
* 1 = at least one of the checks above fails,
|
||||
* 2 = usage or I/O error.
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { dirname, join, relative, resolve } from 'node:path'
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
|
||||
const DEFAULTS = {
|
||||
readme: join(REPO_ROOT, 'README.md'),
|
||||
manifesto: join(REPO_ROOT, 'public', 'src', 'data', 'manifesto.js'),
|
||||
assessment: join(REPO_ROOT, 'public', 'src', 'data', 'assessment.js'),
|
||||
references: join(REPO_ROOT, 'public', 'src', 'data', 'references.js')
|
||||
}
|
||||
|
||||
const usage = [
|
||||
'Usage: node scripts/check-citations.mjs [--readme <file>] [--manifesto <file>]',
|
||||
' [--assessment <file>] [--references <file>]',
|
||||
'',
|
||||
'Checks that every research claim and figure in README.md and public/src/data',
|
||||
'carries an inline [id] citation or a BEAT-default marker, and that every id',
|
||||
'resolves to a reference entry in the README ## References section and in',
|
||||
'public/src/data/references.js. A reference entry that is never cited fails.',
|
||||
'',
|
||||
'Exit codes: 0 = all claims and citations resolve, 1 = a check fails, 2 = usage or I/O error.'
|
||||
].join('\n')
|
||||
|
||||
/* ------------------------------------------------------------------ options */
|
||||
|
||||
function readOptions (argv) {
|
||||
const takesValue = new Map([
|
||||
['--readme', 'readme'],
|
||||
['--manifesto', 'manifesto'],
|
||||
['--assessment', 'assessment'],
|
||||
['--references', 'references']
|
||||
])
|
||||
const options = { ...DEFAULTS }
|
||||
|
||||
for (let index = 0; index < argv.length; index++) {
|
||||
const argument = argv[index]
|
||||
if (argument === '--help' || argument === '-h') {
|
||||
options.help = true
|
||||
continue
|
||||
}
|
||||
if (!argument.startsWith('-')) throw new Error(`unexpected argument: ${argument}`)
|
||||
const equals = argument.indexOf('=')
|
||||
const name = equals === -1 ? argument : argument.slice(0, equals)
|
||||
if (!takesValue.has(name)) throw new Error(`unknown option: ${argument}`)
|
||||
let value
|
||||
if (equals === -1) {
|
||||
value = argv[index + 1]
|
||||
index += 1
|
||||
if (value === undefined || value.startsWith('-')) throw new Error(`${name} needs a value`)
|
||||
} else {
|
||||
value = argument.slice(equals + 1)
|
||||
if (value === '') throw new Error(`${name} needs a value`)
|
||||
}
|
||||
options[takesValue.get(name)] = resolve(value)
|
||||
}
|
||||
return options
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- primitives */
|
||||
|
||||
const CITATION_RE = /\[([a-z][a-z0-9]*(?:-[a-z0-9]+)*)]/g
|
||||
const MARKER_RE = /BEAT default|BEAT'?s own|not a research finding|not research findings|not a measured threshold/i
|
||||
const RESEARCH_RE = /\b(survey\w*|stud(?:y|ies|ied)|reported|participant\w*|respondent\w*|trial)\b/i
|
||||
/** A research term under `not ...`/`no ...`/`never ...` is a disclaimer, not a claim. */
|
||||
const NEGATION_RE = /\b(not|no|never)\s+(?:\w+\s+){0,2}?(survey\w*|stud(?:y|ies|ied)|reported|participant\w*|respondent\w*|trial)/i
|
||||
const HAS_DIGIT_RE = /\d/
|
||||
const HAS_PERCENT_RE = /%/
|
||||
|
||||
/** Bracketed inline citation ids, skipping markdown links `[text](url)`. */
|
||||
function citationsIn (text) {
|
||||
const ids = []
|
||||
CITATION_RE.lastIndex = 0
|
||||
let match = CITATION_RE.exec(text)
|
||||
while (match !== null) {
|
||||
if (text[match.index + match[0].length] !== '(') ids.push(match[1])
|
||||
match = CITATION_RE.exec(text)
|
||||
}
|
||||
return ids
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- README side */
|
||||
|
||||
/**
|
||||
* Scan the README. Returns the reference entries of the `## References`
|
||||
* section, every inline citation id used outside that section, and every
|
||||
* checked claim line with its resolution.
|
||||
*/
|
||||
function scanReadme (markdown, label) {
|
||||
const lines = markdown.split('\n')
|
||||
const result = { label, references: [], citations: [], checked: [], skippedStructured: 0, totalLines: lines.length }
|
||||
let inCodeFence = false
|
||||
let inReferences = false
|
||||
|
||||
for (let index = 0; index < lines.length; index++) {
|
||||
const raw = lines[index]
|
||||
const line = raw.trim()
|
||||
const at = `${label}:${index + 1}`
|
||||
|
||||
if (line.startsWith('```')) {
|
||||
inCodeFence = !inCodeFence
|
||||
continue
|
||||
}
|
||||
if (inCodeFence) {
|
||||
result.skippedStructured += 1
|
||||
continue
|
||||
}
|
||||
if (/^##\s+References\s*$/.test(line)) {
|
||||
inReferences = true
|
||||
continue
|
||||
}
|
||||
if (inReferences) {
|
||||
const entry = /^\s*-\s+\*\*\[([a-z][a-z0-9-]*)\]\*\*/.exec(raw)
|
||||
if (entry) result.references.push({ id: entry[1], at, text: line })
|
||||
continue
|
||||
}
|
||||
if (line === '' || line.startsWith('<!--') || /^#{1,6}\s/.test(line)) continue
|
||||
if (line.startsWith('|')) { result.skippedStructured += 1; continue }
|
||||
if (/^\*BEAT v\d/.test(line)) { result.skippedStructured += 1; continue }
|
||||
|
||||
let body = line
|
||||
const numberedStep = /^\d+\.\s+(.*)$/.exec(body)
|
||||
if (numberedStep !== null) body = numberedStep[1]
|
||||
if (/^\*\*\d+\.\s.*\*\*$/.test(body)) { result.skippedStructured += 1; continue }
|
||||
if (/^-\s+\*\*[^*]+\*\*\s*\(/.test(body)) { result.skippedStructured += 1; continue }
|
||||
if (/^\*\*[^*]{1,48}?[.:]\*\*/.test(body)) { result.skippedStructured += 1; continue }
|
||||
|
||||
for (const id of citationsIn(body)) result.citations.push({ id, at })
|
||||
|
||||
if (HAS_DIGIT_RE.test(body) || HAS_PERCENT_RE.test(body) || (RESEARCH_RE.test(body) && !NEGATION_RE.test(body))) {
|
||||
const ids = citationsIn(body)
|
||||
const resolved = ids.length > 0 ? ids.every((id) => true) : MARKER_RE.test(body)
|
||||
result.checked.push({ at, body, ids, resolved })
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- data side */
|
||||
|
||||
const EXCLUDED_KEYS = new Set([
|
||||
'icon', 'gradient', 'color', 'id', 'citation', 'stat', 'value', 'label', 'step',
|
||||
'name', 'title', 'constraint', 'limit', 'rule', 'range', 'key', 'dataKey',
|
||||
'heading', 'over', 'valueMore', 'pattern', 'category', 'duration', 'number'
|
||||
])
|
||||
|
||||
/** The last segment of a walk path, e.g. `principles.focus[1].description`. */
|
||||
const pathKey = (path) => (path.split('.').at(-1) ?? '').replace(/\[\d+\]$/, '')
|
||||
|
||||
function walk (value, path, label, result) {
|
||||
if (typeof value === 'string') {
|
||||
const key = pathKey(path)
|
||||
if (key === 'citation') {
|
||||
result.bareCitations.push({ id: value.trim(), at: `${label} ${path}` })
|
||||
return
|
||||
}
|
||||
if (EXCLUDED_KEYS.has(key)) return
|
||||
const ids = citationsIn(value)
|
||||
for (const id of ids) result.citations.push({ id, at: `${label} ${path}` })
|
||||
if (HAS_DIGIT_RE.test(value) || HAS_PERCENT_RE.test(value) || (RESEARCH_RE.test(value) && !NEGATION_RE.test(value))) {
|
||||
const resolved = ids.length > 0 || MARKER_RE.test(value)
|
||||
result.checked.push({ at: `${label} ${path}`, value, ids, resolved })
|
||||
}
|
||||
return
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((item, index) => walk(item, `${path}[${index}]`, label, result))
|
||||
return
|
||||
}
|
||||
if (value !== null && typeof value === 'object') {
|
||||
for (const [key, child] of Object.entries(value)) {
|
||||
walk(child, path === '' ? key : `${path}.${key}`, label, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function loadDataModule (file) {
|
||||
if (!existsSync(file)) throw new Error(`data file not found: ${file}`)
|
||||
return import(pathToFileURL(file).href)
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- main */
|
||||
|
||||
const shorten = (text, limit) => (text.length <= limit ? text : `${text.slice(0, limit - 3)}...`)
|
||||
|
||||
async function main (argv) {
|
||||
const options = readOptions(argv)
|
||||
if (options.help) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
|
||||
const readmeLabel = relative(REPO_ROOT, options.readme)
|
||||
const manifestoLabel = relative(REPO_ROOT, options.manifesto)
|
||||
const assessmentLabel = relative(REPO_ROOT, options.assessment)
|
||||
const referencesLabel = relative(REPO_ROOT, options.references)
|
||||
|
||||
const readme = scanReadme(readFileSync(options.readme, 'utf8'), readmeLabel)
|
||||
const manifesto = await loadDataModule(options.manifesto)
|
||||
const assessment = await loadDataModule(options.assessment)
|
||||
const referencesModule = await loadDataModule(options.references)
|
||||
|
||||
const dataResult = {
|
||||
label: 'data', citations: [], bareCitations: [], checked: []
|
||||
}
|
||||
walk(manifesto, '', manifestoLabel, dataResult)
|
||||
walk(assessment, '', assessmentLabel, dataResult)
|
||||
|
||||
const dataReferences = Array.isArray(referencesModule.references)
|
||||
? referencesModule.references
|
||||
: []
|
||||
const dataRefEntries = dataReferences.map((entry, index) => ({
|
||||
id: typeof entry?.id === 'string' ? entry.id : '',
|
||||
locator: typeof entry?.locator === 'string' ? entry.locator.trim() : '',
|
||||
at: `${referencesLabel} references[${index}]`
|
||||
}))
|
||||
|
||||
/* ------------------------------------------------------------- resolvers */
|
||||
|
||||
const readmeRefIds = new Set(readme.references.map((entry) => entry.id))
|
||||
const dataRefIds = new Set(dataRefEntries.map((entry) => entry.id))
|
||||
|
||||
const citedIds = new Set([
|
||||
...readme.citations.map((entry) => entry.id),
|
||||
...dataResult.citations.map((entry) => entry.id),
|
||||
...dataResult.bareCitations.map((entry) => entry.id)
|
||||
])
|
||||
|
||||
const failures = []
|
||||
|
||||
// Every inline citation id must resolve to an entry on BOTH sides.
|
||||
const allCitations = [
|
||||
...readme.citations.map((entry) => ({ ...entry, side: 'README' })),
|
||||
...dataResult.citations.map((entry) => ({ ...entry, side: 'data' }))
|
||||
]
|
||||
for (const { id, at, side } of allCitations) {
|
||||
if (!readmeRefIds.has(id)) failures.push(`${at}: inline citation [${id}] (${side}) resolves to no ${readmeLabel} references entry`)
|
||||
if (!dataRefIds.has(id)) failures.push(`${at}: inline citation [${id}] (${side}) resolves to no ${referencesLabel} entry`)
|
||||
}
|
||||
for (const { id, at } of dataResult.bareCitations) {
|
||||
if (!readmeRefIds.has(id)) failures.push(`${at}: citation field "${id}" resolves to no ${readmeLabel} references entry`)
|
||||
if (!dataRefIds.has(id)) failures.push(`${at}: citation field "${id}" resolves to no ${referencesLabel} entry`)
|
||||
}
|
||||
|
||||
// The two reference sets must agree.
|
||||
for (const id of readmeRefIds) {
|
||||
if (!dataRefIds.has(id)) failures.push(`${readmeLabel} references entry [${id}] has no entry in ${referencesLabel}`)
|
||||
}
|
||||
for (const id of dataRefIds) {
|
||||
if (!readmeRefIds.has(id)) failures.push(`${referencesLabel} entry [${id}] has no entry in the ${readmeLabel} references section`)
|
||||
}
|
||||
|
||||
// Locator sufficiency: README entry needs DOI, ISBN or a locator note;
|
||||
// data entry needs a non-empty locator field.
|
||||
for (const entry of readme.references) {
|
||||
if (!/DOI:|ISBN|—/.test(entry.text)) failures.push(`${entry.at}: reference entry [${entry.id}] carries no DOI, ISBN or locator note`)
|
||||
}
|
||||
for (const entry of dataRefEntries) {
|
||||
if (entry.id === '') failures.push(`${entry.at}: reference entry has no id`)
|
||||
else if (entry.locator === '') failures.push(`${entry.at}: reference entry [${entry.id}] has an empty locator field`)
|
||||
}
|
||||
|
||||
// A reference entry that is never cited fails (not a warning).
|
||||
for (const id of new Set([...readmeRefIds, ...dataRefIds])) {
|
||||
if (!citedIds.has(id)) failures.push(`reference entry [${id}] is never cited by any inline citation`)
|
||||
}
|
||||
|
||||
// Claims: a triggered line or string resolves by citation or marker.
|
||||
for (const claim of readme.checked) {
|
||||
if (!claim.resolved) failures.push(`${claim.at}: uncited claim or figure: "${shorten(claim.body, 96)}"`)
|
||||
}
|
||||
for (const claim of dataResult.checked) {
|
||||
if (!claim.resolved) failures.push(`${claim.at}: uncited claim or figure: "${shorten(claim.value, 96)}"`)
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- reporting */
|
||||
|
||||
console.log('check-citations: BEAT inline citation check')
|
||||
console.log(`check-citations: repo ${REPO_ROOT}`)
|
||||
console.log(`check-citations: README ${readmeLabel} (${readme.totalLines} lines, ${readme.skippedStructured} structured line(s) carved out, ${readme.checked.length} claim line(s) checked, ${readme.references.length} reference entrie(s))`)
|
||||
console.log(`check-citations: data ${manifestoLabel} + ${assessmentLabel} (${dataResult.checked.length} prose claim(s) checked)`)
|
||||
console.log(`check-citations: references ${referencesLabel} (${dataRefEntries.length} entrie(s))`)
|
||||
console.log('')
|
||||
|
||||
console.log(`check-citations: README reference entries (${readme.references.length})`)
|
||||
for (const entry of readme.references) {
|
||||
console.log(`check-citations: ${entry.id.padEnd(26)} ${entry.at}`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
console.log(`check-citations: data reference entries (${dataRefEntries.length})`)
|
||||
for (const entry of dataRefEntries) {
|
||||
console.log(`check-citations: ${entry.id.padEnd(26)} ${entry.at} locator: ${entry.locator === '' ? '(EMPTY)' : 'present'}`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
console.log(`check-citations: inline citations used (${new Set(allCitations.map((c) => c.id)).size} distinct id(s), ${allCitations.length} site(s))`)
|
||||
for (const entry of readme.citations) console.log(`check-citations: [${entry.id}] ${entry.at}`)
|
||||
for (const entry of dataResult.citations) console.log(`check-citations: [${entry.id}] ${entry.at}`)
|
||||
for (const entry of dataResult.bareCitations) console.log(`check-citations: [${entry.id}] ${entry.at} (citation field)`)
|
||||
console.log('')
|
||||
|
||||
console.log(`check-citations: README claim lines checked (${readme.checked.length})`)
|
||||
for (const claim of readme.checked) {
|
||||
const how = claim.ids.length > 0 ? `cited [${claim.ids.join(', ')}]` : 'BEAT-default marker'
|
||||
console.log(`check-citations: ${claim.at} ${how} "${shorten(claim.body, 72)}"`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
console.log(`check-citations: data prose claims checked (${dataResult.checked.length})`)
|
||||
for (const claim of dataResult.checked) {
|
||||
const how = claim.ids.length > 0 ? `cited [${claim.ids.join(', ')}]` : (claim.resolved ? 'BEAT-default marker' : 'UNRESOLVED')
|
||||
console.log(`check-citations: ${claim.at} ${how} "${shorten(claim.value, 64)}"`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
if (failures.length > 0) {
|
||||
console.log(`check-citations: FAIL, ${failures.length} defect(s)`)
|
||||
for (const failure of failures) console.log(`check-citations: ${failure}`)
|
||||
console.log('')
|
||||
console.log(`check-citations: ${readme.checked.length} README claim line(s), ${dataResult.checked.length} data prose claim(s), ${readme.references.length} README reference entrie(s), ${dataRefEntries.length} data reference entrie(s), ${allCitations.length + dataResult.bareCitations.length} citation site(s), ${failures.length} defect(s)`)
|
||||
return 1
|
||||
}
|
||||
|
||||
console.log(`check-citations: PASS, ${readme.checked.length} README claim line(s) and ${dataResult.checked.length} data prose claim(s) all resolve, ${readme.references.length} README and ${dataRefEntries.length} data reference entrie(s) agree, every citation resolves on both sides, every entry cited and located`)
|
||||
return 0
|
||||
}
|
||||
|
||||
import { existsSync } from 'node:fs'
|
||||
|
||||
try {
|
||||
process.exitCode = await main(process.argv.slice(2))
|
||||
} catch (error) {
|
||||
console.error(`check-citations: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exitCode = 2
|
||||
}
|
||||
Executable
+458
@@ -0,0 +1,458 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* check-consistency.mjs
|
||||
*
|
||||
* Plain Node script (no dependency, no test framework) that proves README.md
|
||||
* and the site content in public/src/data carry the same set of sections and
|
||||
* principles, and that docs/section-principle-map.md maps every one of them to
|
||||
* a README heading and a data key that actually exist.
|
||||
*
|
||||
* Where the two id sets come from:
|
||||
* - README.md: the `<!-- id: xxx -->` HTML comment anchors.
|
||||
* - public/src/data/manifesto.js: the `sectionMap` export, which spreads the
|
||||
* four principle rows in from `principleSections`; the module is imported,
|
||||
* so the spread is resolved by the language rather than re-parsed here.
|
||||
*
|
||||
* The run fails (exit 1) when:
|
||||
* - an id exists on only one side;
|
||||
* - an id that exists on either side has no row in the map;
|
||||
* - a map row names an id that is on neither side;
|
||||
* - a map row names a README heading or a data key that does not exist.
|
||||
*
|
||||
* Two things are reported but never fail the run, because neither is an id
|
||||
* set: `framework.subsections` (a content list; the run reports how many names
|
||||
* it holds and how many of them match a README heading) and the map's anchor
|
||||
* line numbers (they move whenever an edit above them adds a line).
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-consistency.mjs
|
||||
* node scripts/check-consistency.mjs [--readme <file>] [--manifesto <file>]
|
||||
* [--assessment <file>] [--map <file>]
|
||||
*
|
||||
* Options:
|
||||
* --readme <file> README to read the id anchors from (default: README.md)
|
||||
* --manifesto <file> data file holding `sectionMap` (default: public/src/data/manifesto.js)
|
||||
* --assessment <file> data file holding the assessment keys (default: public/src/data/assessment.js)
|
||||
* --map <file> mapping document (default: docs/section-principle-map.md)
|
||||
*
|
||||
* Exit codes: 0 = the two id sets match and every map row resolves,
|
||||
* 1 = at least one of the checks above fails,
|
||||
* 2 = usage or I/O error.
|
||||
*/
|
||||
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { dirname, join, relative, resolve } from 'node:path'
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
|
||||
const DEFAULTS = {
|
||||
readme: join(REPO_ROOT, 'README.md'),
|
||||
manifesto: join(REPO_ROOT, 'public', 'src', 'data', 'manifesto.js'),
|
||||
assessment: join(REPO_ROOT, 'public', 'src', 'data', 'assessment.js'),
|
||||
map: join(REPO_ROOT, 'docs', 'section-principle-map.md')
|
||||
}
|
||||
|
||||
const usage = [
|
||||
'Usage: node scripts/check-consistency.mjs [--readme <file>] [--manifesto <file>]',
|
||||
' [--assessment <file>] [--map <file>]',
|
||||
'',
|
||||
'Compares the README id anchors and the manifesto sectionMap against the rows of',
|
||||
'docs/section-principle-map.md.',
|
||||
'',
|
||||
'Options:',
|
||||
' --readme <file> README to read the id anchors from (default: README.md)',
|
||||
' --manifesto <file> data file holding sectionMap (default: public/src/data/manifesto.js)',
|
||||
' --assessment <file> data file holding the assessment keys (default: public/src/data/assessment.js)',
|
||||
' --map <file> mapping document (default: docs/section-principle-map.md)',
|
||||
'',
|
||||
'Exit codes: 0 = sets match and every map row resolves, 1 = a check fails, 2 = usage or I/O error.'
|
||||
].join('\n')
|
||||
|
||||
const ANCHOR_RE = /<!--\s*id:\s*([^\s>]+?)\s*-->/g
|
||||
const HEADING_RE = /^(#{1,6})\s+(.+?)\s*$/
|
||||
const CODE_SPAN_RE = /`([^`]+)`/
|
||||
|
||||
// The map table is the one table whose header carries all four columns; the
|
||||
// other tables in the document (the five situations, the out-of-scope
|
||||
// namespaces) have a different column set and are not map rows.
|
||||
const MAP_COLUMNS = {
|
||||
id: /^id$/i,
|
||||
heading: /readme heading/i,
|
||||
anchor: /anchor line/i,
|
||||
dataKey: /site data key/i
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ options */
|
||||
|
||||
function readOptions (argv) {
|
||||
const takesValue = new Map([
|
||||
['--readme', 'readme'],
|
||||
['--manifesto', 'manifesto'],
|
||||
['--assessment', 'assessment'],
|
||||
['--map', 'map']
|
||||
])
|
||||
const options = { ...DEFAULTS }
|
||||
|
||||
for (let index = 0; index < argv.length; index++) {
|
||||
const argument = argv[index]
|
||||
if (argument === '--help' || argument === '-h') {
|
||||
options.help = true
|
||||
continue
|
||||
}
|
||||
if (!argument.startsWith('-')) throw new Error(`unexpected argument: ${argument}`)
|
||||
const equals = argument.indexOf('=')
|
||||
const name = equals === -1 ? argument : argument.slice(0, equals)
|
||||
if (!takesValue.has(name)) throw new Error(`unknown option: ${argument}`)
|
||||
let value
|
||||
if (equals === -1) {
|
||||
value = argv[index + 1]
|
||||
index += 1
|
||||
if (value === undefined || value.startsWith('-')) throw new Error(`${name} needs a value`)
|
||||
} else {
|
||||
value = argument.slice(equals + 1)
|
||||
if (value === '') throw new Error(`${name} needs a value`)
|
||||
}
|
||||
options[takesValue.get(name)] = resolve(value)
|
||||
}
|
||||
return options
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ README side */
|
||||
|
||||
/** The `<!-- id: xxx -->` anchors, with the line each one sits on. */
|
||||
function readReadmeIds (markdown) {
|
||||
const ids = []
|
||||
const lines = markdown.split('\n')
|
||||
for (let index = 0; index < lines.length; index++) {
|
||||
ANCHOR_RE.lastIndex = 0
|
||||
let match = ANCHOR_RE.exec(lines[index])
|
||||
while (match !== null) {
|
||||
ids.push({ id: match[1], line: index + 1 })
|
||||
match = ANCHOR_RE.exec(lines[index])
|
||||
}
|
||||
}
|
||||
return ids
|
||||
}
|
||||
|
||||
/** The Markdown headings, with level, text and line. */
|
||||
function readReadmeHeadings (markdown) {
|
||||
const headings = []
|
||||
const lines = markdown.split('\n')
|
||||
for (let index = 0; index < lines.length; index++) {
|
||||
const match = HEADING_RE.exec(lines[index])
|
||||
if (match === null) continue
|
||||
headings.push({ level: match[1].length, text: match[2].replace(/\s+#+$/, '').trim(), line: index + 1 })
|
||||
}
|
||||
return headings
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- data side */
|
||||
|
||||
async function loadDataModule (file) {
|
||||
if (!existsSync(file)) throw new Error(`data file not found: ${file}`)
|
||||
return import(pathToFileURL(file).href)
|
||||
}
|
||||
|
||||
/** The `sectionMap` export, as `{ id, heading, dataKey }` rows. */
|
||||
function readSectionMap (namespace, file) {
|
||||
const sectionMap = namespace.sectionMap
|
||||
if (!Array.isArray(sectionMap)) {
|
||||
throw new Error(`${file} has no sectionMap array export`)
|
||||
}
|
||||
return sectionMap.map((row, index) => {
|
||||
if (row === null || typeof row !== 'object' || typeof row.id !== 'string' || row.id.trim() === '') {
|
||||
throw new Error(`${file} sectionMap[${index}] has no string id`)
|
||||
}
|
||||
return {
|
||||
id: row.id.trim(),
|
||||
heading: typeof row.heading === 'string' ? row.heading : '',
|
||||
dataKey: typeof row.dataKey === 'string' ? row.dataKey : ''
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** Resolve a dotted key such as `principles.focus` against a module namespace. */
|
||||
function resolveDataKey (key, modules) {
|
||||
for (const [label, namespace] of modules) {
|
||||
let value = namespace
|
||||
let found = true
|
||||
for (const part of key.split('.')) {
|
||||
if (value === null || typeof value !== 'object' || !(part in value)) {
|
||||
found = false
|
||||
break
|
||||
}
|
||||
value = value[part]
|
||||
}
|
||||
if (found) return { file: label, value }
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- map document */
|
||||
|
||||
function splitCells (line) {
|
||||
return line
|
||||
.replace(/^\|/, '')
|
||||
.replace(/\|$/, '')
|
||||
.split('|')
|
||||
.map((cell) => cell.trim())
|
||||
}
|
||||
|
||||
/** The first code span of a cell, which is how the map quotes ids and keys. */
|
||||
function firstCodeSpan (cell) {
|
||||
const match = CODE_SPAN_RE.exec(cell)
|
||||
return match === null ? null : match[1].trim()
|
||||
}
|
||||
|
||||
function readMapRows (markdown) {
|
||||
const lines = markdown.split('\n')
|
||||
const rows = []
|
||||
let columns = null
|
||||
|
||||
for (let index = 0; index < lines.length; index++) {
|
||||
const line = lines[index].trim()
|
||||
if (!line.startsWith('|')) {
|
||||
columns = null
|
||||
continue
|
||||
}
|
||||
const cells = splitCells(line)
|
||||
if (columns === null) {
|
||||
const found = {}
|
||||
for (const [name, matcher] of Object.entries(MAP_COLUMNS)) {
|
||||
const at = cells.findIndex((cell) => matcher.test(cell))
|
||||
if (at !== -1) found[name] = at
|
||||
}
|
||||
if (Object.keys(found).length === Object.keys(MAP_COLUMNS).length) columns = found
|
||||
continue
|
||||
}
|
||||
if (cells.every((cell) => /^:?-{2,}:?$/.test(cell))) continue
|
||||
rows.push({ cells, columns, line: index + 1 })
|
||||
}
|
||||
|
||||
return rows.map(({ cells, columns, line }) => {
|
||||
const cell = (name) => cells[columns[name]] ?? ''
|
||||
const anchorMatch = /line\s+(\d+)/i.exec(cell('anchor'))
|
||||
return {
|
||||
line,
|
||||
id: firstCodeSpan(cell('id')),
|
||||
heading: firstCodeSpan(cell('heading')),
|
||||
anchorLine: anchorMatch === null ? null : Number(anchorMatch[1]),
|
||||
dataKey: firstCodeSpan(cell('dataKey'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- main */
|
||||
|
||||
const normalize = (text) => text.replace(/\s+/g, ' ').trim().toLowerCase()
|
||||
|
||||
/** First line after `line` that carries content: not blank, not another anchor. */
|
||||
function markedLine (lines, line) {
|
||||
for (let index = line; index < lines.length; index++) {
|
||||
const text = lines[index].trim()
|
||||
if (text === '' || text.startsWith('<!--')) continue
|
||||
return { line: index + 1, text }
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
const shorten = (text, limit) => (text.length <= limit ? text : `${text.slice(0, limit - 3)}...`)
|
||||
|
||||
async function main (argv) {
|
||||
const options = readOptions(argv)
|
||||
if (options.help) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
|
||||
const readmeText = readFileSync(options.readme, 'utf8')
|
||||
const mapText = readFileSync(options.map, 'utf8')
|
||||
const manifesto = await loadDataModule(options.manifesto)
|
||||
const assessment = await loadDataModule(options.assessment)
|
||||
|
||||
const readmeIds = readReadmeIds(readmeText)
|
||||
const readmeHeadings = readReadmeHeadings(readmeText)
|
||||
const sectionMap = readSectionMap(manifesto, relative(REPO_ROOT, options.manifesto))
|
||||
const mapRows = readMapRows(mapText)
|
||||
|
||||
const modules = [
|
||||
[relative(REPO_ROOT, options.manifesto), manifesto],
|
||||
[relative(REPO_ROOT, options.assessment), assessment]
|
||||
]
|
||||
|
||||
const readmeSet = new Set(readmeIds.map((entry) => entry.id))
|
||||
const dataSet = new Set(sectionMap.map((entry) => entry.id))
|
||||
const mapSet = new Set(mapRows.filter((row) => row.id !== null).map((row) => row.id))
|
||||
|
||||
const readmeOnly = [...readmeSet].filter((id) => !dataSet.has(id)).sort()
|
||||
const dataOnly = [...dataSet].filter((id) => !readmeSet.has(id)).sort()
|
||||
const bothSides = [...readmeSet].filter((id) => dataSet.has(id)).sort()
|
||||
const unmapped = [...new Set([...readmeSet, ...dataSet])].filter((id) => !mapSet.has(id)).sort()
|
||||
const orphanMapRows = [...mapSet].filter((id) => !readmeSet.has(id) && !dataSet.has(id)).sort()
|
||||
|
||||
const headingsByText = new Map()
|
||||
for (const heading of readmeHeadings) {
|
||||
const key = normalize(heading.text)
|
||||
if (!headingsByText.has(key)) headingsByText.set(key, heading)
|
||||
}
|
||||
|
||||
const dataKeysById = new Map(sectionMap.map((entry) => [entry.id, entry.dataKey]))
|
||||
const anchorLineById = new Map(readmeIds.map((entry) => [entry.id, entry.line]))
|
||||
|
||||
const failures = []
|
||||
const notes = []
|
||||
|
||||
if (readmeOnly.length > 0) failures.push(`${readmeOnly.length} id(s) on the README side only: ${readmeOnly.join(', ')}`)
|
||||
if (dataOnly.length > 0) failures.push(`${dataOnly.length} id(s) on the data side only: ${dataOnly.join(', ')}`)
|
||||
if (unmapped.length > 0) failures.push(`${unmapped.length} id(s) with no row in the map: ${unmapped.join(', ')}`)
|
||||
if (orphanMapRows.length > 0) failures.push(`${orphanMapRows.length} map row(s) naming an id that is on neither side: ${orphanMapRows.join(', ')}`)
|
||||
|
||||
for (const row of mapRows) {
|
||||
const where = `${relative(REPO_ROOT, options.map)}:${row.line}`
|
||||
if (row.id === null) {
|
||||
failures.push(`${where} map row has no id`)
|
||||
continue
|
||||
}
|
||||
if (row.heading === null) {
|
||||
failures.push(`${where} ${row.id}: map row has no README heading`)
|
||||
} else {
|
||||
const heading = headingsByText.get(normalize(row.heading))
|
||||
if (heading === undefined) {
|
||||
failures.push(`${where} ${row.id}: README heading "${row.heading}" does not exist in ${relative(REPO_ROOT, options.readme)}`)
|
||||
} else if (heading.text !== row.heading) {
|
||||
notes.push(`${row.id}: README heading is "${heading.text}", map row says "${row.heading}" (letter case only, not a mismatch)`)
|
||||
}
|
||||
}
|
||||
if (row.dataKey === null) {
|
||||
failures.push(`${where} ${row.id}: map row has no site data key`)
|
||||
} else if (resolveDataKey(row.dataKey, modules) === null) {
|
||||
failures.push(`${where} ${row.id}: data key "${row.dataKey}" does not exist in ${relative(REPO_ROOT, options.manifesto)} or ${relative(REPO_ROOT, options.assessment)}`)
|
||||
}
|
||||
if (row.anchorLine !== null) {
|
||||
const actual = anchorLineById.get(row.id)
|
||||
if (actual === undefined) {
|
||||
notes.push(`${row.id}: map row states anchor line ${row.anchorLine}, but there is no such anchor`)
|
||||
} else if (actual !== row.anchorLine) {
|
||||
notes.push(`${row.id}: map row states anchor line ${row.anchorLine}, the anchor is at line ${actual} (line numbers drift, not a mismatch)`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const duplicates = (entries) => {
|
||||
const seen = new Set()
|
||||
const repeated = new Set()
|
||||
for (const entry of entries) {
|
||||
if (seen.has(entry.id)) repeated.add(entry.id)
|
||||
seen.add(entry.id)
|
||||
}
|
||||
return [...repeated].sort()
|
||||
}
|
||||
const duplicateReadme = duplicates(readmeIds)
|
||||
const duplicateData = duplicates(sectionMap)
|
||||
if (duplicateReadme.length > 0) notes.push(`README anchor repeated: ${duplicateReadme.join(', ')}`)
|
||||
if (duplicateData.length > 0) notes.push(`sectionMap id repeated: ${duplicateData.join(', ')}`)
|
||||
|
||||
for (const id of bothSides) {
|
||||
const fromMap = mapRows.find((row) => row.id === id)?.dataKey
|
||||
const fromData = dataKeysById.get(id)
|
||||
if (fromMap !== undefined && fromMap !== fromData) {
|
||||
notes.push(`${id}: map row data key "${fromMap}" differs from sectionMap data key "${fromData}"`)
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- reporting */
|
||||
|
||||
const readmeLabel = relative(REPO_ROOT, options.readme)
|
||||
const mapLabel = relative(REPO_ROOT, options.map)
|
||||
console.log('check-consistency: BEAT section and principle consistency')
|
||||
console.log(`check-consistency: repo ${REPO_ROOT}`)
|
||||
console.log(`check-consistency: README ${readmeLabel} (${readmeText.split('\n').length} lines, ${readmeIds.length} id anchor(s), ${readmeHeadings.length} heading(s))`)
|
||||
console.log(`check-consistency: data ${relative(REPO_ROOT, options.manifesto)} (sectionMap, ${sectionMap.length} id(s))`)
|
||||
console.log(`check-consistency: map ${mapLabel} (${mapRows.length} row(s))`)
|
||||
console.log('')
|
||||
|
||||
console.log(`check-consistency: README id set (${readmeSet.size})`)
|
||||
const idWidth = Math.max(4, ...[...readmeSet].map((id) => id.length))
|
||||
const readmeLines = readmeText.split('\n')
|
||||
for (const entry of [...readmeIds].sort((a, b) => a.id.localeCompare(b.id))) {
|
||||
// An anchor sits inside a section and may mark either the heading that
|
||||
// follows it or a paragraph under an earlier heading, so both are shown.
|
||||
const enclosing = readmeHeadings.filter((heading) => heading.line < entry.line).at(-1)
|
||||
const under = enclosing === undefined
|
||||
? 'no heading above it'
|
||||
: `under "${enclosing.text}" (H${enclosing.level}, line ${enclosing.line})`
|
||||
const marked = markedLine(readmeLines, entry.line)
|
||||
const marks = marked === null ? 'nothing after it' : `marks line ${marked.line}: ${shorten(marked.text, 64)}`
|
||||
console.log(`check-consistency: ${entry.id.padEnd(idWidth)} ${readmeLabel}:${entry.line} ${under}; ${marks}`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
console.log(`check-consistency: data id set (${dataSet.size}) from sectionMap`)
|
||||
for (const entry of [...sectionMap].sort((a, b) => a.id.localeCompare(b.id))) {
|
||||
console.log(`check-consistency: ${entry.id.padEnd(idWidth)} dataKey=${entry.dataKey} heading="${entry.heading}"`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
console.log(`check-consistency: on both sides (${bothSides.length}): ${bothSides.join(', ') || '(none)'}`)
|
||||
console.log(`check-consistency: README only (${readmeOnly.length}): ${readmeOnly.join(', ') || '(none)'}`)
|
||||
console.log(`check-consistency: data only (${dataOnly.length}): ${dataOnly.join(', ') || '(none)'}`)
|
||||
console.log('')
|
||||
|
||||
console.log(`check-consistency: map rows (${mapRows.length}) against both sides`)
|
||||
for (const row of mapRows) {
|
||||
if (row.id === null) {
|
||||
console.log(`check-consistency: ${mapLabel}:${row.line} no id in this row`)
|
||||
continue
|
||||
}
|
||||
const heading = row.heading === null ? null : headingsByText.get(normalize(row.heading))
|
||||
const headingText = heading === undefined || heading === null
|
||||
? `heading "${row.heading ?? '(none)'}" NOT FOUND`
|
||||
: `heading "${heading.text}" at ${readmeLabel}:${heading.line}`
|
||||
const resolved = row.dataKey === null ? null : resolveDataKey(row.dataKey, modules)
|
||||
const keyText = row.dataKey === null
|
||||
? 'data key (none)'
|
||||
: resolved === null
|
||||
? `data key "${row.dataKey}" NOT FOUND`
|
||||
: `data key "${row.dataKey}" at ${resolved.file}`
|
||||
const anchorText = row.anchorLine === null ? 'anchor line (none)' : `anchor line ${row.anchorLine}`
|
||||
console.log(`check-consistency: ${row.id.padEnd(idWidth)} ${headingText}; ${keyText}; ${anchorText}`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
const subsections = Array.isArray(manifesto.framework?.subsections) ? manifesto.framework.subsections : []
|
||||
const matchedSubsections = subsections.filter((name) => headingsByText.has(normalize(String(name))))
|
||||
const unmatchedSubsections = subsections.filter((name) => !headingsByText.has(normalize(String(name))))
|
||||
console.log(`check-consistency: framework.subsections (informational, a content list, not an id set)`)
|
||||
console.log(`check-consistency: ${subsections.length} name(s), ${matchedSubsections.length} match a ${readmeLabel} heading, ${unmatchedSubsections.length} do not`)
|
||||
for (const name of unmatchedSubsections) {
|
||||
console.log(`check-consistency: no heading for "${name}"`)
|
||||
}
|
||||
console.log('')
|
||||
|
||||
if (notes.length > 0) {
|
||||
console.log(`check-consistency: notes (${notes.length}, informational, not failures)`)
|
||||
for (const note of notes) console.log(`check-consistency: ${note}`)
|
||||
console.log('')
|
||||
}
|
||||
|
||||
if (failures.length > 0) {
|
||||
console.log(`check-consistency: FAIL, ${failures.length} mismatch(es)`)
|
||||
for (const failure of failures) console.log(`check-consistency: ${failure}`)
|
||||
console.log('')
|
||||
console.log(`check-consistency: ${readmeSet.size} README id(s), ${dataSet.size} data id(s), ${bothSides.length} on both sides, ${readmeOnly.length + dataOnly.length} one-sided, ${mapRows.length} map row(s), ${unmapped.length} unmapped, ${failures.length} mismatch(es)`)
|
||||
return 1
|
||||
}
|
||||
|
||||
console.log(`check-consistency: PASS, ${readmeSet.size} README id(s) and ${dataSet.size} data id(s), ${bothSides.length} on both sides, 0 one-sided, ${mapRows.length} map row(s) covering every id, every heading and data key resolved`)
|
||||
return 0
|
||||
}
|
||||
|
||||
try {
|
||||
process.exitCode = await main(process.argv.slice(2))
|
||||
} catch (error) {
|
||||
console.error(`check-consistency: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exitCode = 2
|
||||
}
|
||||
Executable
+392
@@ -0,0 +1,392 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* check-contrast.mjs
|
||||
*
|
||||
* Plain Node script (no runtime dependency, no test framework) that measures
|
||||
* the WCAG 2.2 contrast ratio of every foreground/background pair of the
|
||||
* theme token contract, in the light theme and in the dark theme.
|
||||
*
|
||||
* The token values come from the token stylesheet: the `:root` block holds
|
||||
* the light values and the `.dark` block holds the dark values. The pairs
|
||||
* come from a separate data file (scripts/contrast-pairs.json by default),
|
||||
* so the list of measured pairs is reviewable on its own.
|
||||
*
|
||||
* The thresholds follow WCAG 2.2:
|
||||
* body text 4.5:1 (SC 1.4.3 Contrast Minimum)
|
||||
* large text 3:1 (SC 1.4.3, large-scale text)
|
||||
* UI component 3:1 (SC 1.4.11 Non-text Contrast)
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-contrast.mjs [--tokens <file>] [--pairs <file>]
|
||||
* [--json] [--help]
|
||||
*
|
||||
* Exit codes: 0 = every pair meets its threshold, 1 = at least one pair is
|
||||
* below its threshold, 2 = bad usage or I/O error.
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { dirname, join, relative, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
const DEFAULT_TOKENS = join(REPO_ROOT, 'public', 'src', 'main.css')
|
||||
const DEFAULT_PAIRS = join(SCRIPT_DIR, 'contrast-pairs.json')
|
||||
|
||||
/** The WCAG 2.2 minimum for each pair category. */
|
||||
const THRESHOLDS = {
|
||||
'body-text': 4.5,
|
||||
'large-text': 3,
|
||||
'ui-component': 3,
|
||||
}
|
||||
|
||||
const THEMES = ['light', 'dark']
|
||||
|
||||
const usage = `Usage: node scripts/check-contrast.mjs [options]
|
||||
|
||||
--tokens <file> token stylesheet to read (default: public/src/main.css)
|
||||
--pairs <file> pair list to read (default: scripts/contrast-pairs.json)
|
||||
--json print the measurements as JSON instead of a table
|
||||
--help print this text
|
||||
Exit codes: 0 = all pairs pass, 1 = at least one pair fails, 2 = usage or I/O error.`
|
||||
|
||||
/* ------------------------------------------------------------------ colours */
|
||||
|
||||
/**
|
||||
* Parse a CSS colour into its sRGB channels.
|
||||
*
|
||||
* Hex colours (#rgb, #rrggbb, #rrggbbaa) and the rgb()/rgba() function are
|
||||
* supported, which covers every form a token value can take.
|
||||
*/
|
||||
function parseColor (value) {
|
||||
const text = String(value).trim()
|
||||
|
||||
const hex = /^#([0-9a-f]{3,8})$/i.exec(text)
|
||||
if (hex) {
|
||||
const digits = hex[1]
|
||||
const expand = digits.length <= 4
|
||||
? digits.split('').map((d) => d + d).join('')
|
||||
: digits
|
||||
if (expand.length !== 6 && expand.length !== 8) {
|
||||
throw new Error(`unsupported hex colour: ${text}`)
|
||||
}
|
||||
return {
|
||||
r: parseInt(expand.slice(0, 2), 16),
|
||||
g: parseInt(expand.slice(2, 4), 16),
|
||||
b: parseInt(expand.slice(4, 6), 16),
|
||||
a: expand.length === 8 ? parseInt(expand.slice(6, 8), 16) / 255 : 1,
|
||||
}
|
||||
}
|
||||
|
||||
const rgb = /^rgba?\(\s*([^)]+)\)$/i.exec(text)
|
||||
if (rgb) {
|
||||
const parts = rgb[1].split(/[\s,/]+/).filter(Boolean)
|
||||
if (parts.length < 3) throw new Error(`unsupported rgb colour: ${text}`)
|
||||
const channel = (part) => (part.endsWith('%')
|
||||
? Math.round((parseFloat(part) / 100) * 255)
|
||||
: parseInt(part, 10))
|
||||
const alpha = parts[3] === undefined
|
||||
? 1
|
||||
: (parts[3].endsWith('%') ? parseFloat(parts[3]) / 100 : parseFloat(parts[3]))
|
||||
return {
|
||||
r: channel(parts[0]),
|
||||
g: channel(parts[1]),
|
||||
b: channel(parts[2]),
|
||||
a: alpha,
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(`unsupported colour value: ${text}`)
|
||||
}
|
||||
|
||||
/** Composite a translucent colour over an opaque one. */
|
||||
function flatten (top, bottom) {
|
||||
const alpha = top.a
|
||||
if (alpha >= 1) return { r: top.r, g: top.g, b: top.b }
|
||||
return {
|
||||
r: Math.round(top.r * alpha + bottom.r * (1 - alpha)),
|
||||
g: Math.round(top.g * alpha + bottom.g * (1 - alpha)),
|
||||
b: Math.round(top.b * alpha + bottom.b * (1 - alpha)),
|
||||
}
|
||||
}
|
||||
|
||||
/** The relative luminance of a colour, per WCAG 2.2. */
|
||||
function relativeLuminance ({ r, g, b }) {
|
||||
const channel = (value) => {
|
||||
const srgb = value / 255
|
||||
return srgb <= 0.04045 ? srgb / 12.92 : ((srgb + 0.055) / 1.055) ** 2.4
|
||||
}
|
||||
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b)
|
||||
}
|
||||
|
||||
/**
|
||||
* The contrast ratio between two colours, per WCAG 2.2.
|
||||
*
|
||||
* A translucent foreground is composited over the background first, because
|
||||
* that is what the reader sees.
|
||||
*/
|
||||
function contrastRatio (foreground, background) {
|
||||
const fg = flatten(foreground, background)
|
||||
const bg = { r: background.r, g: background.g, b: background.b }
|
||||
const lighter = Math.max(relativeLuminance(fg), relativeLuminance(bg))
|
||||
const darker = Math.min(relativeLuminance(fg), relativeLuminance(bg))
|
||||
return (lighter + 0.05) / (darker + 0.05)
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- token file */
|
||||
|
||||
/**
|
||||
* Read the custom properties of one block of a stylesheet.
|
||||
*
|
||||
* The block is selected by its selector, so the same reader finds the light
|
||||
* values in `:root` and the dark values in `.dark`.
|
||||
*/
|
||||
function readBlock (css, selector) {
|
||||
const pattern = new RegExp(`(^|[}\\s,])${selector.replace('.', '\\.')}\\s*\\{`, 'm')
|
||||
const match = pattern.exec(css)
|
||||
if (!match) throw new Error(`no "${selector}" block in the token file`)
|
||||
|
||||
const start = match.index + match[0].length
|
||||
const end = css.indexOf('}', start)
|
||||
if (end === -1) throw new Error(`unterminated "${selector}" block in the token file`)
|
||||
|
||||
const values = new Map()
|
||||
for (const entry of css.slice(start, end).split(';')) {
|
||||
const declaration = entry.trim()
|
||||
if (declaration === '' || declaration.startsWith('/*')) continue
|
||||
const colon = declaration.indexOf(':')
|
||||
if (colon === -1) continue
|
||||
values.set(declaration.slice(0, colon).trim(), declaration.slice(colon + 1).trim())
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
||||
/** The token values of both themes, read from the token stylesheet. */
|
||||
function readTokens (tokenPath) {
|
||||
let css
|
||||
try {
|
||||
css = readFileSync(tokenPath, 'utf8')
|
||||
} catch {
|
||||
throw new Error(`cannot read token file: ${tokenPath}`)
|
||||
}
|
||||
const light = readBlock(css, ':root')
|
||||
const dark = readBlock(css, '.dark')
|
||||
return { light, dark }
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- pair list */
|
||||
|
||||
/** Read and validate the pair list. */
|
||||
function readPairs (pairsPath) {
|
||||
let data
|
||||
try {
|
||||
data = JSON.parse(readFileSync(pairsPath, 'utf8'))
|
||||
} catch (error) {
|
||||
throw new Error(`cannot read pair list: ${pairsPath} (${error.message})`)
|
||||
}
|
||||
if (!data || !Array.isArray(data.pairs) || data.pairs.length === 0) {
|
||||
throw new Error(`pair list has no pairs: ${pairsPath}`)
|
||||
}
|
||||
|
||||
const ids = new Set()
|
||||
return data.pairs.map((pair) => {
|
||||
for (const field of ['id', 'category', 'foreground', 'background']) {
|
||||
if (typeof pair[field] !== 'string' || pair[field].trim() === '') {
|
||||
throw new Error(`pair is missing "${field}": ${JSON.stringify(pair)}`)
|
||||
}
|
||||
}
|
||||
if (!Object.hasOwn(THRESHOLDS, pair.category)) {
|
||||
throw new Error(
|
||||
`pair "${pair.id}" has unknown category "${pair.category}"; ` +
|
||||
`known categories: ${Object.keys(THRESHOLDS).join(', ')}`
|
||||
)
|
||||
}
|
||||
if (ids.has(pair.id)) throw new Error(`duplicate pair id: ${pair.id}`)
|
||||
ids.add(pair.id)
|
||||
|
||||
// The pair list states the threshold it needs. The category default
|
||||
// must agree with it, so a wrong threshold cannot slip in unnoticed.
|
||||
const categoryThreshold = THRESHOLDS[pair.category]
|
||||
let threshold = categoryThreshold
|
||||
if (pair.threshold !== undefined) {
|
||||
if (typeof pair.threshold !== 'number' || !Number.isFinite(pair.threshold)) {
|
||||
throw new Error(`pair "${pair.id}" has a non-numeric threshold: ${pair.threshold}`)
|
||||
}
|
||||
if (Math.abs(pair.threshold - categoryThreshold) > 1e-9) {
|
||||
throw new Error(
|
||||
`pair "${pair.id}" has threshold ${pair.threshold}, but category ` +
|
||||
`"${pair.category}" requires ${categoryThreshold}`
|
||||
)
|
||||
}
|
||||
threshold = pair.threshold
|
||||
}
|
||||
|
||||
return {
|
||||
id: pair.id,
|
||||
category: pair.category,
|
||||
foreground: pair.foreground,
|
||||
background: pair.background,
|
||||
surface: typeof pair.surface === 'string' ? pair.surface : '',
|
||||
threshold,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ measurement */
|
||||
|
||||
/**
|
||||
* Measure every pair in both themes.
|
||||
*
|
||||
* A pair whose tokens are missing from a theme is reported as an error
|
||||
* rather than skipped: a missing token is a contrast failure the site
|
||||
* cannot recover from.
|
||||
*/
|
||||
function measure (pairs, tokens) {
|
||||
const results = []
|
||||
for (const pair of pairs) {
|
||||
const themes = {}
|
||||
for (const theme of THEMES) {
|
||||
const foregroundValue = tokens[theme].get(pair.foreground)
|
||||
const backgroundValue = tokens[theme].get(pair.background)
|
||||
if (foregroundValue === undefined || backgroundValue === undefined) {
|
||||
const missing = [
|
||||
foregroundValue === undefined ? pair.foreground : null,
|
||||
backgroundValue === undefined ? pair.background : null,
|
||||
].filter(Boolean).join(', ')
|
||||
themes[theme] = {
|
||||
error: `token not defined in the ${theme} theme: ${missing}`,
|
||||
foregroundValue: foregroundValue ?? null,
|
||||
backgroundValue: backgroundValue ?? null,
|
||||
ratio: null,
|
||||
pass: false,
|
||||
}
|
||||
continue
|
||||
}
|
||||
const foreground = parseColor(foregroundValue)
|
||||
const background = parseColor(backgroundValue)
|
||||
const ratio = contrastRatio(foreground, background)
|
||||
themes[theme] = {
|
||||
error: null,
|
||||
foregroundValue,
|
||||
backgroundValue,
|
||||
ratio: Number(ratio.toFixed(2)),
|
||||
pass: ratio >= pair.threshold - 1e-9,
|
||||
}
|
||||
}
|
||||
results.push({ ...pair, themes })
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- output */
|
||||
|
||||
/** Format a ratio for the report: two decimals, or a placeholder. */
|
||||
const formatRatio = (ratio) => (ratio === null ? 'n/a' : `${ratio.toFixed(2)}:1`)
|
||||
|
||||
function printTable (results, tokenPath, pairsPath) {
|
||||
const shown = (file) => relative(process.cwd(), file) || file
|
||||
console.log(`check-contrast: token file ${shown(tokenPath)}`)
|
||||
console.log(`check-contrast: pair list ${shown(pairsPath)}`)
|
||||
console.log(`check-contrast: ${results.length} pair(s) measured in ${THEMES.length} theme(s)`)
|
||||
console.log('')
|
||||
|
||||
for (const theme of THEMES) {
|
||||
console.log(`theme: ${theme}`)
|
||||
for (const result of results) {
|
||||
const measurement = result.themes[theme]
|
||||
const status = measurement.error
|
||||
? 'ERROR'
|
||||
: (measurement.pass ? 'pass' : 'FAIL')
|
||||
console.log(
|
||||
` ${status.padEnd(5)} ${result.id} ` +
|
||||
`(${result.foreground} ${measurement.foregroundValue ?? 'n/a'} on ` +
|
||||
`${result.background} ${measurement.backgroundValue ?? 'n/a'}) ` +
|
||||
`ratio ${formatRatio(measurement.ratio)}, ` +
|
||||
`required ${result.threshold.toFixed(1)}:1` +
|
||||
(measurement.error ? ` - ${measurement.error}` : '')
|
||||
)
|
||||
}
|
||||
console.log('')
|
||||
}
|
||||
}
|
||||
|
||||
/** The failing measurements, in a stable order. */
|
||||
function failures (results) {
|
||||
const failing = []
|
||||
for (const result of results) {
|
||||
for (const theme of THEMES) {
|
||||
const measurement = result.themes[theme]
|
||||
if (!measurement.pass) failing.push({ result, theme, measurement })
|
||||
}
|
||||
}
|
||||
return failing
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- main */
|
||||
|
||||
function main (argv) {
|
||||
if (argv.includes('--help') || argv.includes('-h')) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
const known = new Set(['--tokens', '--pairs', '--json', '--help', '-h'])
|
||||
const unknown = argv.filter((argument) => argument.startsWith('-') && !known.has(argument))
|
||||
if (unknown.length > 0) throw new Error(`unknown option: ${unknown[0]}`)
|
||||
|
||||
const optionValue = (name) => {
|
||||
const index = argv.indexOf(name)
|
||||
return index === -1 ? null : (argv[index + 1] ?? null)
|
||||
}
|
||||
const tokenOption = optionValue('--tokens')
|
||||
const pairsOption = optionValue('--pairs')
|
||||
if (argv.includes('--tokens') && tokenOption === null) throw new Error('--tokens needs a file path')
|
||||
if (argv.includes('--pairs') && pairsOption === null) throw new Error('--pairs needs a file path')
|
||||
|
||||
const tokenPath = tokenOption === null ? DEFAULT_TOKENS : resolve(process.cwd(), tokenOption)
|
||||
const pairsPath = pairsOption === null ? DEFAULT_PAIRS : resolve(process.cwd(), pairsOption)
|
||||
|
||||
const tokens = readTokens(tokenPath)
|
||||
const pairs = readPairs(pairsPath)
|
||||
const results = measure(pairs, tokens)
|
||||
const failing = failures(results)
|
||||
|
||||
if (argv.includes('--json')) {
|
||||
console.log(JSON.stringify({
|
||||
tokenFile: tokenPath,
|
||||
pairFile: pairsPath,
|
||||
pairs: results.length,
|
||||
failures: failing.length,
|
||||
results,
|
||||
}, null, 2))
|
||||
return failing.length > 0 ? 1 : 0
|
||||
}
|
||||
|
||||
printTable(results, tokenPath, pairsPath)
|
||||
|
||||
const measurements = results.length * THEMES.length
|
||||
console.log(
|
||||
`check-contrast: ${results.length} pair(s), ${measurements} measurement(s), ` +
|
||||
`${measurements - failing.length} pass, ${failing.length} fail`
|
||||
)
|
||||
if (failing.length > 0) {
|
||||
console.log('')
|
||||
console.log('failing pairs:')
|
||||
for (const { result, theme, measurement } of failing) {
|
||||
const reason = measurement.error ?? 'contrast ratio below the required threshold'
|
||||
console.log(
|
||||
` ${result.id} [${theme}] ${result.foreground} ${measurement.foregroundValue ?? 'n/a'} on ` +
|
||||
`${result.background} ${measurement.backgroundValue ?? 'n/a'}: ` +
|
||||
`ratio ${formatRatio(measurement.ratio)}, required ${result.threshold.toFixed(1)}:1 - ${reason}`
|
||||
)
|
||||
}
|
||||
}
|
||||
return failing.length > 0 ? 1 : 0
|
||||
}
|
||||
|
||||
try {
|
||||
process.exit(main(process.argv.slice(2)))
|
||||
} catch (error) {
|
||||
console.error(`check-contrast: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exit(2)
|
||||
}
|
||||
Executable
+407
@@ -0,0 +1,407 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* check-design-rules.mjs
|
||||
*
|
||||
* Plain Node script (no runtime dependency) that checks the design rules of
|
||||
* the BEAT site mechanically:
|
||||
*
|
||||
* emoji no emoji characters
|
||||
* gradient-utility no gradient utilities (bg-gradient-*, from-*, via-*, to-*)
|
||||
* gradient-decl no linear-gradient / radial-gradient / conic-gradient
|
||||
* inline-style no inline style attributes
|
||||
* style-block no <style> blocks in Vue components
|
||||
* icon-markup no icon markup other than FontAwesome components or classes
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-design-rules.mjs [path ...]
|
||||
*
|
||||
* Paths default to README.md and public/src, relative to the repository root.
|
||||
* Exit codes: 0 = no violations, 1 = violations found, 2 = bad usage or I/O error.
|
||||
*/
|
||||
|
||||
import { readFileSync, readdirSync, statSync } from 'node:fs'
|
||||
import { dirname, extname, join, relative, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
const DEFAULT_TARGETS = [join(REPO_ROOT, 'README.md'), join(REPO_ROOT, 'public/src')]
|
||||
|
||||
const SKIP_DIRS = new Set(['node_modules', 'dist', '.git', 'coverage', '.vite', '.locust'])
|
||||
const TEXT_EXTENSIONS = new Set([
|
||||
'.md', '.mdx', '.vue', '.js', '.mjs', '.cjs', '.ts', '.jsx', '.tsx',
|
||||
'.css', '.html', '.json', '.txt'
|
||||
])
|
||||
const MARKUP_EXTENSIONS = new Set(['.vue', '.html'])
|
||||
const VUE_EXTENSIONS = new Set(['.vue'])
|
||||
|
||||
const RULE_IDS = [
|
||||
'emoji',
|
||||
'gradient-utility',
|
||||
'gradient-decl',
|
||||
'inline-style',
|
||||
'style-block',
|
||||
'icon-markup'
|
||||
]
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Emoji
|
||||
//
|
||||
// A character counts as an emoji when it renders as one by default
|
||||
// (Emoji_Presentation), when it is a pictograph that carries the emoji
|
||||
// presentation selector U+FE0F (for example the heart in "❤️"), or when it is
|
||||
// a keycap sequence (U+20E3). Text-presentation dingbats that are commonly
|
||||
// used in plain text - such as U+2713 CHECK MARK - are not emoji and stay
|
||||
// allowed.
|
||||
// ---------------------------------------------------------------------------
|
||||
const EMOJI_PRESENTATION_RE = /\p{Emoji_Presentation}/u
|
||||
const EXTENDED_PICTOGRAPHIC_RE = /\p{Extended_Pictographic}/u
|
||||
const EMOJI_KEYCAP = '\u20E3'
|
||||
const EMOJI_SELECTOR = '\uFE0F'
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Gradients
|
||||
//
|
||||
// The colour list keeps the rule from firing on ordinary prose ("from the
|
||||
// team") and keeps Tailwind's position utilities (to-top, to-bottom,
|
||||
// to-left, to-right) out of the gradient rule.
|
||||
// ---------------------------------------------------------------------------
|
||||
const COLOR_TOKEN =
|
||||
'(?:transparent|current|inherit|white|black|slate|gray|zinc|neutral|stone|' +
|
||||
'red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|' +
|
||||
'violet|purple|fuchsia|pink|rose)'
|
||||
const COLOR_SCALE = '(?:-\\d{2,3})?(?:/\\d{1,3})?'
|
||||
// An arbitrary value, for example from-[#6366f1].
|
||||
const COLOR_ARBITRARY = '(?:\\[[^\\]\\s]+\\])'
|
||||
const GRADIENT_UTILITY_RES = [
|
||||
{ re: /\bbg-gradient-[A-Za-z0-9_-]+/g, name: 'bg-gradient-*' },
|
||||
{ re: /\bbg-linear-[A-Za-z0-9_-]+/g, name: 'bg-linear-*' },
|
||||
{ re: new RegExp(`\\bfrom-(?:${COLOR_TOKEN}${COLOR_SCALE}|${COLOR_ARBITRARY})`, 'g'), name: 'from-*' },
|
||||
{ re: new RegExp(`\\bvia-(?:${COLOR_TOKEN}${COLOR_SCALE}|${COLOR_ARBITRARY})`, 'g'), name: 'via-*' },
|
||||
{ re: new RegExp(`\\bto-(?:${COLOR_TOKEN}${COLOR_SCALE}|${COLOR_ARBITRARY})`, 'g'), name: 'to-*' }
|
||||
]
|
||||
const GRADIENT_DECL_RE =
|
||||
/(?:-webkit-|-moz-|-o-)?(?:repeating-)?(?:linear|radial|conic)-gradient\s*\(/gi
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Inline styles
|
||||
//
|
||||
// Static style="..." attributes and bound :style="..." / v-bind:style="..."
|
||||
// bindings. The lookbehind keeps JavaScript property assignments such as
|
||||
// "el.style = 'x'" out of the rule.
|
||||
// ---------------------------------------------------------------------------
|
||||
const INLINE_STYLE_RE = /(?<![\w$.])(?::|v-bind:)?style\s*=\s*["']/g
|
||||
|
||||
// <style> blocks inside Vue single-file components.
|
||||
const STYLE_BLOCK_RE = /<style(\s[^>]*)?>/gi
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Icons
|
||||
//
|
||||
// FontAwesome is the only allowed icon system: the FontAwesome free style
|
||||
// prefixes (fa, fas, far, fal, fat, fab, ...), any fa-* icon class, and the
|
||||
// FontAwesome Vue components. Everything else - inline SVG, Material
|
||||
// Symbols, Lucide, Heroicons and similar - is a violation.
|
||||
// ---------------------------------------------------------------------------
|
||||
const FA_EXACT_TOKENS = new Set([
|
||||
'fa', 'fas', 'far', 'fal', 'fat', 'fab', 'fad', 'fass',
|
||||
'fa-solid', 'fa-regular', 'fa-brands', 'fa-light', 'fa-thin',
|
||||
'fa-duotone', 'fa-sharp', 'fa-classic', 'fa-kit'
|
||||
])
|
||||
const isFontAwesomeToken = (token) => FA_EXACT_TOKENS.has(token) || token.startsWith('fa-')
|
||||
|
||||
const NON_FA_EXACT_TOKENS = new Set([
|
||||
'material-icons', 'material-symbols', 'material-symbols-rounded',
|
||||
'material-symbols-outlined', 'mdi', 'bi', 'lucide', 'heroicon', 'heroicons',
|
||||
'feather', 'feather-icon', 'ti', 'ai', 'remixicon', 'octicon', 'devicon',
|
||||
'typicons', 'phosphor', 'jam', 'uil', 'gg', 'iconify', 'line-awesome',
|
||||
'uicons', 'bootstrap-icons', 'emojione', 'twemoji', 'emoji'
|
||||
])
|
||||
// Prefixes of common non-FontAwesome icon systems. Tailwind spacing
|
||||
// utilities that share a prefix (pe-*, ms-*, me-*) are deliberately absent.
|
||||
const NON_FA_PREFIXES = [
|
||||
'mdi-', 'bi-', 'lucide-', 'hero-', 'feather-', 'ti-', 'ai-', 'remix-',
|
||||
'ion-', 'uil-', 'gg-', 'emoji-', 'emojione-', 'twemoji-',
|
||||
'material-symbols-', 'material-icons-', 'bootstrap-icons-'
|
||||
]
|
||||
const isNonFontAwesomeToken = (token) =>
|
||||
NON_FA_EXACT_TOKENS.has(token) || NON_FA_PREFIXES.some((prefix) => token.startsWith(prefix))
|
||||
|
||||
const FA_COMPONENT_TAGS = new Set(['font-awesome-icon', 'fa-icon', 'fontawesome-icon'])
|
||||
|
||||
const usage = `Usage: node scripts/check-design-rules.mjs [path ...] [--strict-emoji]
|
||||
|
||||
Paths default to README.md and public/src (relative to the repository root).
|
||||
--strict-emoji also flag text-presentation pictographs (for example U+2713
|
||||
CHECK MARK); by default only characters that render as emoji
|
||||
are flagged.
|
||||
Exit codes: 0 = clean, 1 = violations found, 2 = usage or I/O error.`
|
||||
|
||||
/** Collect the text files under a target path. */
|
||||
function collectFiles (target) {
|
||||
const absolute = resolve(process.cwd(), target)
|
||||
let stats
|
||||
try {
|
||||
stats = statSync(absolute)
|
||||
} catch {
|
||||
throw new Error(`cannot read target: ${target}`)
|
||||
}
|
||||
if (stats.isFile()) return [absolute]
|
||||
const files = []
|
||||
const walk = (dir) => {
|
||||
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
||||
if (entry.isDirectory()) {
|
||||
if (SKIP_DIRS.has(entry.name)) continue
|
||||
walk(join(dir, entry.name))
|
||||
} else if (entry.isFile()) {
|
||||
if (TEXT_EXTENSIONS.has(extname(entry.name))) files.push(join(dir, entry.name))
|
||||
}
|
||||
}
|
||||
}
|
||||
walk(absolute)
|
||||
return files.sort()
|
||||
}
|
||||
|
||||
/** Line/column lookup for an offset inside a text buffer. */
|
||||
function makeLocator (text) {
|
||||
const lineStarts = [0]
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
if (text[i] === '\n') lineStarts.push(i + 1)
|
||||
}
|
||||
return (offset) => {
|
||||
let low = 0
|
||||
let high = lineStarts.length - 1
|
||||
while (low < high) {
|
||||
const mid = (low + high + 1) >> 1
|
||||
if (lineStarts[mid] <= offset) low = mid
|
||||
else high = mid - 1
|
||||
}
|
||||
return { line: low + 1, column: offset - lineStarts[low] + 1 }
|
||||
}
|
||||
}
|
||||
|
||||
const findings = []
|
||||
const addFinding = (file, offset, rule, message, locator) => {
|
||||
const { line, column } = locator(offset)
|
||||
findings.push({ file, line, column, rule, message })
|
||||
}
|
||||
|
||||
/**
|
||||
* Class attribute values of one tag. Static values are collected; a bound
|
||||
* class counts as static only when it is a plain string literal.
|
||||
*/
|
||||
function readClassAttributes (attributeText) {
|
||||
const staticValues = []
|
||||
let hasDynamic = false
|
||||
const attributeRe = /([:@#]?[\w.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g
|
||||
let match
|
||||
while ((match = attributeRe.exec(attributeText)) !== null) {
|
||||
const name = match[1]
|
||||
if (name !== 'class' && name !== ':class' && name !== 'v-bind:class') continue
|
||||
const value = match[2] ?? match[3] ?? match[4] ?? ''
|
||||
if (name === 'class') {
|
||||
staticValues.push(value)
|
||||
continue
|
||||
}
|
||||
const literal = value.trim().match(/^(['"])([\s\S]*)\1$/)
|
||||
if (literal) staticValues.push(literal[2])
|
||||
else hasDynamic = true
|
||||
}
|
||||
return { staticValues, hasDynamic }
|
||||
}
|
||||
|
||||
const tokenizeClasses = (value) =>
|
||||
value.split(/\s+/).map((token) => token.trim()).filter(Boolean)
|
||||
|
||||
/** The markup regions of a file: the template block of a Vue file, or the whole file. */
|
||||
function markupRegions (text, extension) {
|
||||
if (!VUE_EXTENSIONS.has(extension)) return [{ start: 0, end: text.length }]
|
||||
const open = text.search(/<template(\s[^>]*)?>/i)
|
||||
if (open === -1) return []
|
||||
const openEnd = text.indexOf('>', open) + 1
|
||||
const close = text.lastIndexOf('</template>')
|
||||
if (close === -1 || close < openEnd) return []
|
||||
return [{ start: openEnd, end: close }]
|
||||
}
|
||||
|
||||
/** Scan one file for every design-rule violation. */
|
||||
function scanFile (file, text, strictEmoji) {
|
||||
const locator = makeLocator(text)
|
||||
const extension = extname(file)
|
||||
const isMarkup = MARKUP_EXTENSIONS.has(extension)
|
||||
const isVue = VUE_EXTENSIONS.has(extension)
|
||||
|
||||
// Emoji characters. The scan walks code points, not UTF-16 code units, so
|
||||
// astral characters such as U+1F680 are seen as one character.
|
||||
let previousCharacter = ''
|
||||
for (let index = 0; index < text.length; ) {
|
||||
const codePoint = text.codePointAt(index)
|
||||
const character = String.fromCodePoint(codePoint)
|
||||
const width = character.length
|
||||
if (character === EMOJI_SELECTOR) {
|
||||
if (EXTENDED_PICTOGRAPHIC_RE.test(previousCharacter)) {
|
||||
addFinding(file, index, 'emoji', 'emoji presentation selector (U+FE0F) on a pictograph', locator)
|
||||
}
|
||||
previousCharacter = character
|
||||
index += width
|
||||
continue
|
||||
}
|
||||
if (character === EMOJI_KEYCAP) {
|
||||
addFinding(file, index, 'emoji', 'keycap sequence (U+20E3)', locator)
|
||||
previousCharacter = character
|
||||
index += width
|
||||
continue
|
||||
}
|
||||
if (!EMOJI_PRESENTATION_RE.test(character)) {
|
||||
if (strictEmoji && EXTENDED_PICTOGRAPHIC_RE.test(character)) {
|
||||
const strictCodePoint = codePoint.toString(16).toUpperCase()
|
||||
addFinding(
|
||||
file,
|
||||
index,
|
||||
'emoji',
|
||||
`pictograph "${character}" (U+${strictCodePoint.padStart(4, '0')}), text presentation`,
|
||||
locator
|
||||
)
|
||||
}
|
||||
previousCharacter = character
|
||||
index += width
|
||||
continue
|
||||
}
|
||||
const hex = codePoint.toString(16).toUpperCase()
|
||||
addFinding(
|
||||
file,
|
||||
index,
|
||||
'emoji',
|
||||
`emoji character "${character}" (U+${hex.padStart(4, '0')})`,
|
||||
locator
|
||||
)
|
||||
previousCharacter = character
|
||||
index += width
|
||||
}
|
||||
|
||||
// Gradient utilities and gradient declarations.
|
||||
for (const { re, name } of GRADIENT_UTILITY_RES) {
|
||||
for (const match of text.matchAll(re)) {
|
||||
addFinding(file, match.index, 'gradient-utility', `gradient utility "${match[0]}" (${name})`, locator)
|
||||
}
|
||||
}
|
||||
for (const match of text.matchAll(GRADIENT_DECL_RE)) {
|
||||
addFinding(file, match.index, 'gradient-decl', `gradient declaration "${match[0].trim()}"`, locator)
|
||||
}
|
||||
|
||||
if (isVue) {
|
||||
// <style> blocks in Vue single-file components.
|
||||
for (const match of text.matchAll(STYLE_BLOCK_RE)) {
|
||||
addFinding(file, match.index, 'style-block', '<style> block in Vue component', locator)
|
||||
}
|
||||
}
|
||||
|
||||
if (!isMarkup) return
|
||||
|
||||
for (const region of markupRegions(text, extension)) {
|
||||
const regionText = text.slice(region.start, region.end)
|
||||
|
||||
// Inline style attributes.
|
||||
for (const match of regionText.matchAll(INLINE_STYLE_RE)) {
|
||||
addFinding(file, region.start + match.index, 'inline-style', 'inline style attribute', locator)
|
||||
}
|
||||
|
||||
// Icon markup: inline SVG, icon systems other than FontAwesome, and <i>
|
||||
// elements that carry no FontAwesome class.
|
||||
const tagRe = /<([a-zA-Z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)\/?>/g
|
||||
for (const match of regionText.matchAll(tagRe)) {
|
||||
const tag = match[1].toLowerCase()
|
||||
const attributeText = match[2] ?? ''
|
||||
|
||||
if (tag === 'svg') {
|
||||
addFinding(file, region.start + match.index, 'icon-markup', 'inline <svg> element; use a FontAwesome icon', locator)
|
||||
continue
|
||||
}
|
||||
if (FA_COMPONENT_TAGS.has(tag)) continue
|
||||
|
||||
const { staticValues, hasDynamic } = readClassAttributes(attributeText)
|
||||
const tokens = staticValues.flatMap(tokenizeClasses)
|
||||
|
||||
for (const token of tokens) {
|
||||
if (isNonFontAwesomeToken(token)) {
|
||||
addFinding(
|
||||
file,
|
||||
region.start + match.index,
|
||||
'icon-markup',
|
||||
`icon class "${token}" is not a FontAwesome class`,
|
||||
locator
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (tag === 'i') {
|
||||
const hasFontAwesome = tokens.some(isFontAwesomeToken)
|
||||
if (!hasFontAwesome && !hasDynamic) {
|
||||
addFinding(
|
||||
file,
|
||||
region.start + match.index,
|
||||
'icon-markup',
|
||||
'<i> icon element without a FontAwesome class',
|
||||
locator
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function main (argv) {
|
||||
if (argv.includes('--help') || argv.includes('-h')) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
const known = new Set(['--strict-emoji', '--help', '-h'])
|
||||
const unknown = argv.filter((argument) => argument.startsWith('-') && !known.has(argument))
|
||||
if (unknown.length > 0) throw new Error(`unknown option: ${unknown[0]}`)
|
||||
const strictEmoji = argv.includes('--strict-emoji')
|
||||
const paths = argv.filter((argument) => !argument.startsWith('-'))
|
||||
const targets = paths.length > 0 ? paths : DEFAULT_TARGETS
|
||||
|
||||
const files = []
|
||||
for (const target of targets) {
|
||||
for (const file of collectFiles(target)) {
|
||||
if (!files.includes(file)) files.push(file)
|
||||
}
|
||||
}
|
||||
files.sort()
|
||||
|
||||
for (const file of files) {
|
||||
const text = readFileSync(file, 'utf8')
|
||||
if (text.includes('\u0000')) continue
|
||||
scanFile(file, text, strictEmoji)
|
||||
}
|
||||
|
||||
const shown = (file) => relative(process.cwd(), file) || file
|
||||
console.log(`check-design-rules: ${files.length} file(s) scanned across ${targets.length} target(s)`)
|
||||
for (const finding of findings) {
|
||||
console.log(
|
||||
`${shown(finding.file)}:${finding.line}:${finding.column}: ` +
|
||||
`[${finding.rule}] ${finding.message}`
|
||||
)
|
||||
}
|
||||
|
||||
const byRule = new Map(RULE_IDS.map((id) => [id, 0]))
|
||||
for (const finding of findings) byRule.set(finding.rule, byRule.get(finding.rule) + 1)
|
||||
const byFile = new Map()
|
||||
for (const finding of findings) {
|
||||
const name = shown(finding.file)
|
||||
byFile.set(name, (byFile.get(name) ?? 0) + 1)
|
||||
}
|
||||
|
||||
console.log(`${findings.length} violation(s) in ${byFile.size} file(s)`)
|
||||
for (const id of RULE_IDS) console.log(` ${id}: ${byRule.get(id)}`)
|
||||
return findings.length > 0 ? 1 : 0
|
||||
}
|
||||
|
||||
try {
|
||||
process.exit(main(process.argv.slice(2)))
|
||||
} catch (error) {
|
||||
console.error(`check-design-rules: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exit(2)
|
||||
}
|
||||
Executable
+662
@@ -0,0 +1,662 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* check-routes.mjs
|
||||
*
|
||||
* Plain Node script (no runtime dependency, no test framework) that proves
|
||||
* every URL published before the redesign still resolves at the branch head.
|
||||
*
|
||||
* The check has two halves, and both must hold for every old path:
|
||||
*
|
||||
* 1. Router half. The old paths are read out of docs/pre-redesign-routes.md
|
||||
* (the committed "before" list) and each one is resolved against the
|
||||
* route table of public/src/router/index.js: a route path, an alias of a
|
||||
* route, or the target of a redirect.
|
||||
*
|
||||
* 2. Published-output half. The site is published from the directory the
|
||||
* GitHub Pages workflow uploads (./public/dist). A cold request to an old
|
||||
* URL is answered by that directory: the app shell at the base path and
|
||||
* the 404.html fallback at every other path. Both must boot the app from
|
||||
* the same entry bundle, and the route table inside that bundle must
|
||||
* still carry the old path and resolve it to the same target as the
|
||||
* router config.
|
||||
*
|
||||
* The route list is read at run time, so a path added to the document later
|
||||
* is picked up without editing this script.
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/check-routes.mjs [--routes <file>] [--router <file>] [--dist <dir>]
|
||||
*
|
||||
* Options:
|
||||
* --routes <file> pre-redesign route list (default: docs/pre-redesign-routes.md)
|
||||
* --router <file> router config (default: public/src/router/index.js)
|
||||
* --dist <dir> published output (default: the directory the workflow uploads)
|
||||
*
|
||||
* Exit codes: 0 = every old path resolves, 1 = at least one path does not
|
||||
* resolve, 2 = bad usage or I/O error.
|
||||
*/
|
||||
|
||||
import { existsSync, readFileSync, readdirSync } from 'node:fs'
|
||||
import { dirname, join, relative, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import vm from 'node:vm'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
const DEFAULT_ROUTES_DOC = join(REPO_ROOT, 'docs', 'pre-redesign-routes.md')
|
||||
const DEFAULT_ROUTER = join(REPO_ROOT, 'public', 'src', 'router', 'index.js')
|
||||
const WORKFLOW_FILE = join(REPO_ROOT, '.github', 'workflows', 'deploy.yml')
|
||||
const FALLBACK_DIST = resolve(REPO_ROOT, 'public', 'dist')
|
||||
|
||||
const usage = [
|
||||
'Usage: node scripts/check-routes.mjs [--routes <file>] [--router <file>] [--dist <dir>]',
|
||||
'',
|
||||
'Resolves every pre-redesign path against the router config and the published output.',
|
||||
'',
|
||||
'Options:',
|
||||
' --routes <file> pre-redesign route list (default: docs/pre-redesign-routes.md)',
|
||||
' --router <file> router config (default: public/src/router/index.js)',
|
||||
' --dist <dir> published output (default: the directory the Pages workflow uploads)',
|
||||
'',
|
||||
'Exit codes: 0 = every old path resolves, 1 = a path does not resolve, 2 = usage or I/O error.'
|
||||
].join('\n')
|
||||
|
||||
// A local reference points at a file of the build output; everything else is
|
||||
// an external URL or an in-page anchor.
|
||||
const ASSET_ATTRIBUTE_RE = /(?:src|href)\s*=\s*"([^"]*)"/g
|
||||
const APP_MOUNT_RE = /<div\s+id="app"/
|
||||
|
||||
/* ------------------------------------------------------------------ options */
|
||||
|
||||
function readOptions (argv) {
|
||||
const known = new Set(['--help', '-h'])
|
||||
const takesValue = new Map([['--routes', 'routes'], ['--router', 'router'], ['--dist', 'dist']])
|
||||
const options = {}
|
||||
|
||||
for (let index = 0; index < argv.length; index++) {
|
||||
const argument = argv[index]
|
||||
if (!argument.startsWith('-')) throw new Error(`unexpected argument: ${argument}`)
|
||||
if (known.has(argument)) {
|
||||
options.help = true
|
||||
continue
|
||||
}
|
||||
const equals = argument.indexOf('=')
|
||||
const name = equals === -1 ? argument : argument.slice(0, equals)
|
||||
if (!takesValue.has(name)) throw new Error(`unknown option: ${argument}`)
|
||||
let value
|
||||
if (equals === -1) {
|
||||
value = argv[index + 1]
|
||||
index += 1
|
||||
if (value === undefined || value.startsWith('-')) throw new Error(`${name} needs a value`)
|
||||
} else {
|
||||
value = argument.slice(equals + 1)
|
||||
if (value === '') throw new Error(`${name} needs a value`)
|
||||
}
|
||||
options[takesValue.get(name)] = resolve(value)
|
||||
}
|
||||
return options
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- route list */
|
||||
|
||||
/**
|
||||
* The route list is the first cell of the Markdown tables of the document:
|
||||
* a code span that starts with a slash. Every other path literal in the
|
||||
* document (the favicon, the workflow output directory) is not a route.
|
||||
*/
|
||||
function parseRouteList (markdown) {
|
||||
const paths = []
|
||||
const seen = new Set()
|
||||
for (const line of markdown.split('\n')) {
|
||||
const trimmed = line.trim()
|
||||
if (!trimmed.startsWith('|')) continue
|
||||
const cells = trimmed.split('|')
|
||||
if (cells.length < 3) continue
|
||||
const cell = cells[1].trim()
|
||||
const value = cell.startsWith('`') && cell.endsWith('`') ? cell.slice(1, -1).trim() : cell
|
||||
if (!value.startsWith('/')) continue
|
||||
if (seen.has(value)) continue
|
||||
seen.add(value)
|
||||
paths.push(value)
|
||||
}
|
||||
return paths
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------- source scanning */
|
||||
|
||||
/**
|
||||
* Index of the bracket that closes the one at `start`, skipping strings and
|
||||
* comments so a bracket inside them does not end the literal.
|
||||
*/
|
||||
function matchingBracket (source, start) {
|
||||
const pairs = { '[': ']', '{': '}', '(': ')' }
|
||||
const open = source[start]
|
||||
const close = pairs[open]
|
||||
if (close === undefined) return -1
|
||||
|
||||
let depth = 0
|
||||
let index = start
|
||||
let state = 'code'
|
||||
while (index < source.length) {
|
||||
const character = source[index]
|
||||
const next = source[index + 1]
|
||||
if (state === 'code') {
|
||||
if (character === '/' && next === '/') { state = 'line'; index += 2; continue }
|
||||
if (character === '/' && next === '*') { state = 'block'; index += 2; continue }
|
||||
if (character === '"') { state = 'double'; index += 1; continue }
|
||||
if (character === "'") { state = 'single'; index += 1; continue }
|
||||
if (character === '`') { state = 'template'; index += 1; continue }
|
||||
if (character === open) depth += 1
|
||||
else if (character === close) {
|
||||
depth -= 1
|
||||
if (depth === 0) return index
|
||||
}
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (state === 'line') {
|
||||
if (character === '\n') state = 'code'
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (state === 'block') {
|
||||
if (character === '*' && next === '/') { state = 'code'; index += 2; continue }
|
||||
index += 1
|
||||
continue
|
||||
}
|
||||
if (character === '\\') { index += 2; continue }
|
||||
if ((state === 'single' && character === "'") ||
|
||||
(state === 'double' && character === '"') ||
|
||||
(state === 'template' && character === '`')) state = 'code'
|
||||
index += 1
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
/** The objects at the top level of an array body, one string per object. */
|
||||
function splitObjects (body) {
|
||||
const objects = []
|
||||
let index = 0
|
||||
while (index < body.length) {
|
||||
if (body[index] !== '{') { index += 1; continue }
|
||||
const end = matchingBracket(body, index)
|
||||
if (end === -1) break
|
||||
objects.push(body.slice(index, end + 1))
|
||||
index = end + 1
|
||||
}
|
||||
return objects
|
||||
}
|
||||
|
||||
/** The quoted string that starts at `start`, with its value and its end. */
|
||||
function readQuoted (source, start) {
|
||||
const quote = source[start]
|
||||
if (quote !== '"' && quote !== "'" && quote !== '`') return null
|
||||
let index = start + 1
|
||||
let value = ''
|
||||
while (index < source.length) {
|
||||
const character = source[index]
|
||||
if (character === '\\') {
|
||||
value += source[index + 1] ?? ''
|
||||
index += 2
|
||||
continue
|
||||
}
|
||||
if (character === quote) return { value, end: index + 1 }
|
||||
value += character
|
||||
index += 1
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/** The position of the value of an object key, or -1 when the key is absent. */
|
||||
function keyValueStart (object, key) {
|
||||
const match = new RegExp(`(?<=[{,])${key}:\\s*`).exec(object)
|
||||
return match === null ? -1 : match.index + match[0].length
|
||||
}
|
||||
|
||||
/** The quoted values of an array literal, or null when it is not an array. */
|
||||
function readStringList (source, start) {
|
||||
if (source[start] !== '[') return null
|
||||
const end = matchingBracket(source, start)
|
||||
if (end === -1) return null
|
||||
const values = []
|
||||
let index = start + 1
|
||||
while (index < end) {
|
||||
const character = source[index]
|
||||
if (character === '"' || character === "'" || character === '`') {
|
||||
const quoted = readQuoted(source, index)
|
||||
if (quoted === null) return null
|
||||
values.push(quoted.value)
|
||||
index = quoted.end
|
||||
continue
|
||||
}
|
||||
index += 1
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- route model */
|
||||
|
||||
/** Normalize a path: leading slash, no query, no fragment, no trailing slash. */
|
||||
function normalizePath (value) {
|
||||
if (typeof value !== 'string') return null
|
||||
let path = value.trim()
|
||||
if (path === '') return null
|
||||
if (!path.startsWith('/')) path = `/${path}`
|
||||
const cut = path.search(/[?#]/)
|
||||
if (cut !== -1) path = path.slice(0, cut)
|
||||
if (path.length > 1) path = path.replace(/\/+$/, '')
|
||||
return path
|
||||
}
|
||||
|
||||
/** One route of a route table, in the shape the resolver works with. */
|
||||
function describeRoute (route) {
|
||||
const aliases = []
|
||||
if (typeof route.alias === 'string') aliases.push(route.alias)
|
||||
else if (Array.isArray(route.alias)) {
|
||||
for (const alias of route.alias) if (typeof alias === 'string') aliases.push(alias)
|
||||
} else if (route.alias && typeof route.alias === 'object' && typeof route.alias.path === 'string') {
|
||||
aliases.push(route.alias.path)
|
||||
}
|
||||
|
||||
const path = typeof route.path === 'string' ? normalizePath(route.path) : null
|
||||
|
||||
return {
|
||||
path,
|
||||
name: typeof route.name === 'string' ? route.name : null,
|
||||
aliases: aliases.map(normalizePath).filter((alias) => alias !== null),
|
||||
redirect: typeof route.redirect === 'string' ? normalizePath(route.redirect) : null,
|
||||
redirectDynamic: route.redirect !== undefined && route.redirect !== null && typeof route.redirect !== 'string',
|
||||
// A catch-all matches every path, so it resolves nothing to its intended
|
||||
// content and must not count as a resolution.
|
||||
isCatchAll: path === null ? false : path.includes('*')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Follow a redirect to the route it ends at. A redirect target that is not a
|
||||
* route of the table, that redirects again, or that loops does not resolve.
|
||||
*/
|
||||
function followRedirect (redirect, routes) {
|
||||
let current = normalizePath(redirect)
|
||||
const seen = new Set()
|
||||
for (let step = 0; step < 10; step++) {
|
||||
if (current === null) return { target: null, detail: 'the redirect target is not a path' }
|
||||
if (seen.has(current)) return { target: null, detail: 'the redirect chain loops' }
|
||||
seen.add(current)
|
||||
const route = routes.find((entry) => !entry.isCatchAll && (entry.path === current || entry.aliases.includes(current)))
|
||||
if (route === undefined) return { target: null, detail: `the redirect target "${current}" is not a route` }
|
||||
if (route.redirectDynamic) return { target: null, detail: `the redirect target "${current}" has a function redirect` }
|
||||
if (route.redirect !== null) { current = route.redirect; continue }
|
||||
return { target: route.path, detail: `route "${route.name}"` }
|
||||
}
|
||||
return { target: null, detail: 'the redirect chain is too long' }
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve one old path against a route table. A route path, an alias and a
|
||||
* redirect all count, and all three resolve to the page the path leads to.
|
||||
*/
|
||||
function resolvePath (oldPath, routes) {
|
||||
const normalized = normalizePath(oldPath)
|
||||
if (normalized === null) return null
|
||||
|
||||
const describe = (route) => {
|
||||
if (route.redirectDynamic) {
|
||||
return { route, target: null, detail: `route "${route.name}" has a function redirect, which cannot be resolved statically` }
|
||||
}
|
||||
if (route.redirect !== null) {
|
||||
const followed = followRedirect(route.redirect, routes)
|
||||
return {
|
||||
route,
|
||||
target: followed.target,
|
||||
detail: `redirect of route "${route.name}" to "${route.redirect}" (${followed.detail})`
|
||||
}
|
||||
}
|
||||
if (route.path === normalized) {
|
||||
return { route, target: route.path, detail: `route "${route.name}"` }
|
||||
}
|
||||
return { route, target: route.path, detail: `alias of route "${route.name}"` }
|
||||
}
|
||||
|
||||
const byPath = routes.find((route) => !route.isCatchAll && route.path === normalized)
|
||||
if (byPath !== undefined) return describe(byPath)
|
||||
|
||||
const byAlias = routes.find((route) => !route.isCatchAll && route.aliases.includes(normalized))
|
||||
if (byAlias !== undefined) return describe(byAlias)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- router file */
|
||||
|
||||
/**
|
||||
* The route table of the router file, read as data. The file is a Vue module
|
||||
* that imports vue-router and its view components, so it cannot be imported
|
||||
* as-is; only the route table literal is evaluated, and the view components
|
||||
* are never called.
|
||||
*/
|
||||
function readRouterRoutes (routerPath) {
|
||||
const source = readFileSync(routerPath, 'utf8')
|
||||
const declaration = /(?:export\s+)?const\s+routes\s*=\s*/.exec(source)
|
||||
if (declaration === null) throw new Error(`no "const routes = ..." in ${routerPath}`)
|
||||
const start = source.indexOf('[', declaration.index + declaration[0].length)
|
||||
if (start === -1) throw new Error(`the routes export in ${routerPath} is not an array literal`)
|
||||
const end = matchingBracket(source, start)
|
||||
if (end === -1) throw new Error(`the routes array in ${routerPath} is not closed`)
|
||||
const literal = source.slice(start, end + 1)
|
||||
|
||||
const routes = vm.runInNewContext(`(${literal})`, Object.create(null), {
|
||||
importModuleDynamically: (specifier) => {
|
||||
throw new Error(`the router file must not be executed, but it imports ${specifier}`)
|
||||
}
|
||||
})
|
||||
if (!Array.isArray(routes)) throw new Error(`the routes export in ${routerPath} is not an array`)
|
||||
return routes.map(describeRoute)
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------- published output */
|
||||
|
||||
/** Files of the published directory, filtered by extension. */
|
||||
function collectFiles (dir, extension) {
|
||||
const files = []
|
||||
const walk = (current) => {
|
||||
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
||||
const full = join(current, entry.name)
|
||||
if (entry.isDirectory()) walk(full)
|
||||
else if (entry.isFile() && full.endsWith(extension)) files.push(full)
|
||||
}
|
||||
}
|
||||
walk(dir)
|
||||
return files.sort()
|
||||
}
|
||||
|
||||
/** A reference is local when it points at a file of the build output. */
|
||||
function isLocalReference (reference) {
|
||||
if (reference === '') return false
|
||||
if (reference.startsWith('#')) return false
|
||||
if (reference.startsWith('//')) return false
|
||||
if (/^[a-z][a-z0-9+.-]*:/i.test(reference)) return false
|
||||
return true
|
||||
}
|
||||
|
||||
/** The local references of a built document, in the order they appear. */
|
||||
function localReferences (html) {
|
||||
const references = []
|
||||
for (const match of html.matchAll(ASSET_ATTRIBUTE_RE)) {
|
||||
const reference = match[1]
|
||||
if (isLocalReference(reference)) references.push(reference)
|
||||
}
|
||||
return [...new Set(references)]
|
||||
}
|
||||
|
||||
/** Check one built document: it must boot the app and its assets must exist. */
|
||||
function checkDocument (distDir, filePath) {
|
||||
const html = readFileSync(filePath, 'utf8')
|
||||
const problems = []
|
||||
if (!APP_MOUNT_RE.test(html)) problems.push('has no <div id="app"> mount point')
|
||||
const references = localReferences(html)
|
||||
const missing = references.filter((reference) => !existsSync(join(distDir, reference.replace(/^\.?\//, ''))))
|
||||
for (const reference of missing) {
|
||||
problems.push(`references ${reference}, which is not in the published output`)
|
||||
}
|
||||
const scripts = references.filter((reference) => reference.endsWith('.js'))
|
||||
if (scripts.length === 0) problems.push('loads no script, so it cannot boot the app')
|
||||
return { references, scripts, problems }
|
||||
}
|
||||
|
||||
/** The directory the GitHub Pages workflow uploads, read from the workflow. */
|
||||
function publishedDirFromWorkflow () {
|
||||
if (!existsSync(WORKFLOW_FILE)) return null
|
||||
const text = readFileSync(WORKFLOW_FILE, 'utf8')
|
||||
const match = /^[ \t]*path:[ \t]*['"]?([^'"\s]+)['"]?[ \t]*$/m.exec(text)
|
||||
if (match === null) return null
|
||||
return resolve(REPO_ROOT, match[1])
|
||||
}
|
||||
|
||||
/**
|
||||
* The route table inside the built bundle. The bundler keeps the route
|
||||
* records as plain objects, so the built table is read back the same way the
|
||||
* router config is: as data.
|
||||
*
|
||||
* The table is found by its marker, not by matching path literals: the
|
||||
* bundle holds dozens of unrelated `{path:` objects (navigation entries,
|
||||
* router internals) and matching those would accept a path that the app
|
||||
* never routes to.
|
||||
*/
|
||||
function readBuiltRoutes (jsFiles) {
|
||||
const markers = ['routes:[', 'routes=[', 'routes = [']
|
||||
for (const file of jsFiles) {
|
||||
const source = readFileSync(file, 'utf8')
|
||||
for (const marker of markers) {
|
||||
let index = source.indexOf(marker)
|
||||
while (index !== -1) {
|
||||
const arrayStart = index + marker.length - 1
|
||||
const end = matchingBracket(source, arrayStart)
|
||||
if (end !== -1) {
|
||||
const records = splitObjects(source.slice(arrayStart + 1, end))
|
||||
.map((object) => {
|
||||
const pathStart = keyValueStart(object, 'path')
|
||||
const path = pathStart === -1 ? null : readQuoted(object, pathStart)
|
||||
if (path === null) return null
|
||||
const nameStart = keyValueStart(object, 'name')
|
||||
const name = nameStart === -1 ? null : readQuoted(object, nameStart)
|
||||
const aliasStart = keyValueStart(object, 'alias')
|
||||
const alias = aliasStart === -1 ? [] : readStringList(object, aliasStart)
|
||||
const redirectStart = keyValueStart(object, 'redirect')
|
||||
const redirect = redirectStart === -1 ? null : readQuoted(object, redirectStart)
|
||||
return {
|
||||
path: path.value,
|
||||
name: name === null ? null : name.value,
|
||||
alias: alias ?? [],
|
||||
redirect: redirect === null ? null : redirect.value,
|
||||
redirectDynamic: redirectStart !== -1 && redirect === null
|
||||
}
|
||||
})
|
||||
.filter((route) => route !== null)
|
||||
if (records.length > 0) {
|
||||
return { file, routes: records.map(describeRoute) }
|
||||
}
|
||||
}
|
||||
index = source.indexOf(marker, index + 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
return { file: null, routes: [] }
|
||||
}
|
||||
|
||||
/**
|
||||
* The route table of the bundle the published document loads. Only that
|
||||
* bundle decides what a visitor gets, so a table in some other file of the
|
||||
* build output does not count.
|
||||
*/
|
||||
function readLoadedRouteTable (documents, jsFiles) {
|
||||
const byName = new Map(jsFiles.map((file) => [file.split('/').pop(), file]))
|
||||
const candidates = []
|
||||
for (const document of documents) {
|
||||
if (!document.present) continue
|
||||
for (const reference of document.scripts) {
|
||||
const file = byName.get(reference.split('/').pop())
|
||||
if (file !== undefined && !candidates.includes(file)) candidates.push(file)
|
||||
}
|
||||
}
|
||||
for (const file of candidates) {
|
||||
const table = readBuiltRoutes([file])
|
||||
if (table.routes.length > 0) return table
|
||||
}
|
||||
return { file: null, routes: [] }
|
||||
}
|
||||
|
||||
/** The state of the published output. */
|
||||
function inspectPublishedOutput (distDir) {
|
||||
const published = { distDir, exists: false, index: null, fallback: null, jsFiles: [], table: { file: null, routes: [] } }
|
||||
if (!existsSync(distDir)) return published
|
||||
published.exists = true
|
||||
|
||||
const indexPath = join(distDir, 'index.html')
|
||||
published.index = existsSync(indexPath)
|
||||
? { present: true, path: indexPath, ...checkDocument(distDir, indexPath) }
|
||||
: { present: false, path: indexPath, references: [], scripts: [], problems: ['is missing'] }
|
||||
|
||||
const fallbackPath = join(distDir, '404.html')
|
||||
published.fallback = existsSync(fallbackPath)
|
||||
? { present: true, path: fallbackPath, ...checkDocument(distDir, fallbackPath) }
|
||||
: { present: false, path: fallbackPath, references: [], scripts: [], problems: ['is missing'] }
|
||||
|
||||
published.jsFiles = collectFiles(distDir, '.js')
|
||||
published.table = readLoadedRouteTable([published.index, published.fallback], published.jsFiles)
|
||||
return published
|
||||
}
|
||||
|
||||
/**
|
||||
* The published-output half of the check for one old path: the published
|
||||
* directory answers a cold request to the old URL with a document that boots
|
||||
* the app, and the route table inside the built bundle carries the old path
|
||||
* and resolves it to the same target as the router config.
|
||||
*/
|
||||
function checkPublishedOutput (oldPath, target, published) {
|
||||
if (!published.exists) {
|
||||
return { ok: false, reason: `the published output ${published.distDir} does not exist`, detail: null }
|
||||
}
|
||||
if (!published.index.present) {
|
||||
return { ok: false, reason: 'the published output has no index.html (app shell)', detail: null }
|
||||
}
|
||||
if (published.index.problems.length > 0) {
|
||||
return { ok: false, reason: `index.html ${published.index.problems[0]}`, detail: null }
|
||||
}
|
||||
if (!published.fallback.present) {
|
||||
return { ok: false, reason: 'the published output has no 404.html (cold-request fallback)', detail: null }
|
||||
}
|
||||
if (published.fallback.problems.length > 0) {
|
||||
return { ok: false, reason: `404.html ${published.fallback.problems[0]}`, detail: null }
|
||||
}
|
||||
const sameBundle = published.index.scripts.join(' ') === published.fallback.scripts.join(' ')
|
||||
if (!sameBundle) {
|
||||
return { ok: false, reason: 'index.html and 404.html load different bundles, so a cold request boots another build', detail: null }
|
||||
}
|
||||
if (published.table.routes.length === 0) {
|
||||
return { ok: false, reason: 'the built bundle carries no route table', detail: null }
|
||||
}
|
||||
|
||||
const resolved = resolvePath(oldPath, published.table.routes)
|
||||
if (resolved === null) {
|
||||
return { ok: false, reason: 'the built route table has no route, alias or redirect for this path', detail: null }
|
||||
}
|
||||
if (resolved.target === null) {
|
||||
return { ok: false, reason: `the built route table: ${resolved.detail}`, detail: null }
|
||||
}
|
||||
if (normalizePath(target) !== normalizePath(resolved.target)) {
|
||||
return {
|
||||
ok: false,
|
||||
reason: `the built route table resolves it to "${resolved.target}", the router config to "${target}"`,
|
||||
detail: resolved.detail
|
||||
}
|
||||
}
|
||||
return {
|
||||
ok: true,
|
||||
reason: null,
|
||||
detail: `${resolved.detail} in ${relative(published.distDir, published.table.file)}`
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------- main */
|
||||
|
||||
function main (argv) {
|
||||
const options = readOptions(argv)
|
||||
if (options.help) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
|
||||
const routesDoc = options.routes ?? DEFAULT_ROUTES_DOC
|
||||
const routerPath = options.router ?? DEFAULT_ROUTER
|
||||
const distDir = options.dist ?? publishedDirFromWorkflow() ?? FALLBACK_DIST
|
||||
|
||||
if (!existsSync(routesDoc)) {
|
||||
console.error(`check-routes: no route list at ${routesDoc}`)
|
||||
return 2
|
||||
}
|
||||
if (!existsSync(routerPath)) {
|
||||
console.error(`check-routes: no router config at ${routerPath}`)
|
||||
return 2
|
||||
}
|
||||
|
||||
const oldPaths = parseRouteList(readFileSync(routesDoc, 'utf8'))
|
||||
if (oldPaths.length === 0) {
|
||||
console.error(`check-routes: no path found in ${routesDoc}`)
|
||||
return 2
|
||||
}
|
||||
const routes = readRouterRoutes(routerPath)
|
||||
const published = inspectPublishedOutput(distDir)
|
||||
|
||||
console.log(`check-routes: route list ${routesDoc}`)
|
||||
console.log(`check-routes: router ${routerPath}`)
|
||||
console.log(`check-routes: published ${distDir}`)
|
||||
console.log(`check-routes: ${oldPaths.length} old path(s), ${routes.length} route(s) in the router`)
|
||||
|
||||
const documentLine = (label, document) => {
|
||||
if (document === null) {
|
||||
console.log(`check-routes: ${label.padEnd(10)} MISSING ${join(published.distDir, label)}`)
|
||||
return
|
||||
}
|
||||
if (!document.present) {
|
||||
console.log(`check-routes: ${label.padEnd(10)} MISSING ${document.path}`)
|
||||
return
|
||||
}
|
||||
if (document.problems.length > 0) {
|
||||
console.log(`check-routes: ${label.padEnd(10)} BAD ${document.path}: ${document.problems.join('; ')}`)
|
||||
return
|
||||
}
|
||||
console.log(`check-routes: ${label.padEnd(10)} OK ${document.path}: boots the app, ${document.references.length} local reference(s) present`)
|
||||
}
|
||||
documentLine('index.html', published.index)
|
||||
documentLine('404.html', published.fallback)
|
||||
console.log(`check-routes: bundle ${published.jsFiles.length} script(s) in the published output, route table read from ${published.table.file === null ? 'none' : relative(published.distDir, published.table.file)}`)
|
||||
console.log('')
|
||||
|
||||
const results = oldPaths.map((oldPath) => {
|
||||
const resolved = resolvePath(oldPath, routes)
|
||||
const target = resolved === null ? null : resolved.target
|
||||
const built = resolved !== null && resolved.target !== null
|
||||
? checkPublishedOutput(oldPath, target, published)
|
||||
: { ok: false, reason: 'not in the router config', detail: null }
|
||||
return { oldPath, resolved, target, built }
|
||||
})
|
||||
|
||||
const oldWidth = Math.max(...results.map((result) => result.oldPath.length))
|
||||
const targetWidth = Math.max(...results.map((result) => (result.target ?? 'UNRESOLVED').length))
|
||||
|
||||
const failures = []
|
||||
for (const result of results) {
|
||||
const routerDetail = result.resolved === null
|
||||
? 'router: no route path, alias or redirect matches this path'
|
||||
: `router: ${result.resolved.detail}`
|
||||
const builtDetail = result.built.ok
|
||||
? `built: ${result.built.detail}`
|
||||
: `built: ${result.built.reason}`
|
||||
const targetText = result.target ?? 'UNRESOLVED'
|
||||
console.log(`${result.oldPath.padEnd(oldWidth)} -> ${targetText.padEnd(targetWidth)} ${routerDetail} ${builtDetail}`)
|
||||
if (!result.resolved || result.resolved.target === null || !result.built.ok) {
|
||||
failures.push({ oldPath: result.oldPath, target: result.target, routerDetail, builtDetail })
|
||||
}
|
||||
}
|
||||
|
||||
console.log('')
|
||||
if (failures.length > 0) {
|
||||
console.log(`check-routes: ${failures.length} path(s) did not resolve:`)
|
||||
for (const failure of failures) {
|
||||
console.log(` ${failure.oldPath} -> ${failure.target ?? 'UNRESOLVED'}`)
|
||||
console.log(` ${failure.routerDetail}`)
|
||||
console.log(` ${failure.builtDetail}`)
|
||||
}
|
||||
console.log('')
|
||||
}
|
||||
console.log(`check-routes: ${results.length} old path(s) checked, ${results.length - failures.length} resolved, ${failures.length} unresolved`)
|
||||
return failures.length === 0 ? 0 : 1
|
||||
}
|
||||
|
||||
try {
|
||||
process.exit(main(process.argv.slice(2)))
|
||||
} catch (error) {
|
||||
console.error(`check-routes: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exit(2)
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"comment": [
|
||||
"The foreground/background pairs of the theme token contract that the",
|
||||
"contrast harness measures. Every pair names the CSS custom properties",
|
||||
"it reads, so a reviewer can check the list against the token file",
|
||||
"without running anything.",
|
||||
"",
|
||||
"The category fixes the WCAG 2.2 threshold the harness applies:",
|
||||
" body-text 4.5:1 (WCAG 1.4.3, normal-size text)",
|
||||
" large-text 3:1 (WCAG 1.4.3, large-scale text)",
|
||||
" ui-component 3:1 (WCAG 1.4.11, component boundaries)",
|
||||
"",
|
||||
"Every pair also states its own threshold, so the list carries the",
|
||||
"requirement in full and can be reviewed without the harness. The",
|
||||
"harness rejects a pair whose threshold disagrees with its category.",
|
||||
"",
|
||||
"A pair is checked in both themes: the light values come from the :root",
|
||||
"block and the dark values from the .dark block of the token file."
|
||||
],
|
||||
"pairs": [
|
||||
{
|
||||
"id": "body-text-on-background",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-text-body",
|
||||
"background": "--color-background",
|
||||
"surface": "Body copy on the page background"
|
||||
},
|
||||
{
|
||||
"id": "body-text-on-muted",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-text-body",
|
||||
"background": "--color-muted",
|
||||
"surface": "Body copy on a muted surface (card, code block, inset panel)"
|
||||
},
|
||||
{
|
||||
"id": "foreground-on-background",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-foreground",
|
||||
"background": "--color-background",
|
||||
"surface": "Primary text and headings on the page background"
|
||||
},
|
||||
{
|
||||
"id": "foreground-on-muted",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-foreground",
|
||||
"background": "--color-muted",
|
||||
"surface": "Primary text and headings on a muted surface"
|
||||
},
|
||||
{
|
||||
"id": "muted-foreground-on-background",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-muted-foreground",
|
||||
"background": "--color-background",
|
||||
"surface": "Secondary text (captions, metadata, helper text) on the page background"
|
||||
},
|
||||
{
|
||||
"id": "muted-foreground-on-muted",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-muted-foreground",
|
||||
"background": "--color-muted",
|
||||
"surface": "Secondary text on a muted surface"
|
||||
},
|
||||
{
|
||||
"id": "accent-text-on-background",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-accent",
|
||||
"background": "--color-background",
|
||||
"surface": "Link and emphasis text on the page background"
|
||||
},
|
||||
{
|
||||
"id": "accent-text-on-muted",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-accent",
|
||||
"background": "--color-muted",
|
||||
"surface": "Link and emphasis text on a muted surface"
|
||||
},
|
||||
{
|
||||
"id": "accent-foreground-on-accent",
|
||||
"category": "body-text",
|
||||
"threshold": 4.5,
|
||||
"foreground": "--color-accent-foreground",
|
||||
"background": "--color-accent",
|
||||
"surface": "Label text on an accent-filled button or badge"
|
||||
},
|
||||
{
|
||||
"id": "large-text-on-background",
|
||||
"category": "large-text",
|
||||
"threshold": 3,
|
||||
"foreground": "--color-text-large",
|
||||
"background": "--color-background",
|
||||
"surface": "Large headings on the page background"
|
||||
},
|
||||
{
|
||||
"id": "large-text-on-muted",
|
||||
"category": "large-text",
|
||||
"threshold": 3,
|
||||
"foreground": "--color-text-large",
|
||||
"background": "--color-muted",
|
||||
"surface": "Large headings on a muted surface"
|
||||
},
|
||||
{
|
||||
"id": "border-on-background",
|
||||
"category": "ui-component",
|
||||
"threshold": 3,
|
||||
"foreground": "--color-border",
|
||||
"background": "--color-background",
|
||||
"surface": "Control and card boundary on the page background"
|
||||
},
|
||||
{
|
||||
"id": "border-on-muted",
|
||||
"category": "ui-component",
|
||||
"threshold": 3,
|
||||
"foreground": "--color-border",
|
||||
"background": "--color-muted",
|
||||
"surface": "Control and card boundary on a muted surface"
|
||||
},
|
||||
{
|
||||
"id": "accent-boundary-on-background",
|
||||
"category": "ui-component",
|
||||
"threshold": 3,
|
||||
"foreground": "--color-accent",
|
||||
"background": "--color-background",
|
||||
"surface": "Accent control edge and focus indicator on the page background"
|
||||
},
|
||||
{
|
||||
"id": "accent-boundary-on-muted",
|
||||
"category": "ui-component",
|
||||
"threshold": 3,
|
||||
"foreground": "--color-accent",
|
||||
"background": "--color-muted",
|
||||
"surface": "Accent control edge on a muted surface"
|
||||
},
|
||||
{
|
||||
"id": "foreground-boundary-on-background",
|
||||
"category": "ui-component",
|
||||
"threshold": 3,
|
||||
"foreground": "--color-foreground",
|
||||
"background": "--color-background",
|
||||
"surface": "Strong control edge (input outline, toggle track) on the page background"
|
||||
}
|
||||
]
|
||||
}
|
||||
Executable
+152
@@ -0,0 +1,152 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* generate-404.mjs
|
||||
*
|
||||
* Plain Node script (no runtime dependency) that writes the SPA fallback
|
||||
* `dist/404.html` from the built `dist/index.html`.
|
||||
*
|
||||
* The fallback must not be frozen at authoring time. A cold request to an
|
||||
* old URL is answered by the host with the `404.html` document, and that
|
||||
* document has to load the hashed assets of the build that is actually
|
||||
* published. A committed copy of a built index.html goes stale on the next
|
||||
* build, and the fallback then fetches an asset that no longer exists and
|
||||
* boots a blank app. So the fallback is derived from the build output on
|
||||
* every build, and this script runs last, after `vite build` has finished.
|
||||
*
|
||||
* The fallback carries the built index document verbatim, so it has the same
|
||||
* app entry script, stylesheet, favicon, meta tags, pre-paint theme script
|
||||
* and `<div id="app">` mount point as the index page.
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/generate-404.mjs [--dist <dir>]
|
||||
*
|
||||
* The dist directory defaults to <repo>/public/dist and is resolved from the
|
||||
* location of this script, not from process.cwd(), so the generator behaves
|
||||
* the same whether npm is invoked from the repository root or from public/.
|
||||
*
|
||||
* Exit codes: 0 = fallback written, 1 = the build output is not usable,
|
||||
* 2 = bad usage or I/O error.
|
||||
*/
|
||||
|
||||
import { createHash } from 'node:crypto'
|
||||
import { existsSync, readFileSync, writeFileSync } from 'node:fs'
|
||||
import { dirname, join, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const REPO_ROOT = resolve(SCRIPT_DIR, '..')
|
||||
const DEFAULT_DIST_DIR = resolve(REPO_ROOT, 'public', 'dist')
|
||||
|
||||
const usage = [
|
||||
'Usage: node scripts/generate-404.mjs [--dist <dir>]',
|
||||
'',
|
||||
'Writes <dist>/404.html from <dist>/index.html, so the SPA fallback always',
|
||||
'references the assets of the current build.',
|
||||
'',
|
||||
'Options:',
|
||||
' --dist <dir> Build output directory (default: <repo>/public/dist)'
|
||||
].join('\n')
|
||||
|
||||
const ASSET_ATTRIBUTE_RE = /(?:src|href)\s*=\s*"([^"]*)"/g
|
||||
const APP_MOUNT_RE = /<div\s+id="app"/
|
||||
|
||||
/**
|
||||
* A reference is local when it points at a file in the build output.
|
||||
* Absolute URLs, protocol-relative URLs, data URIs and in-page anchors are
|
||||
* not build artefacts and are not checked.
|
||||
*/
|
||||
function isLocalReference (reference) {
|
||||
if (reference === '') return false
|
||||
if (reference.startsWith('#')) return false
|
||||
if (reference.startsWith('//')) return false
|
||||
if (/^[a-z][a-z0-9+.-]*:/i.test(reference)) return false
|
||||
return true
|
||||
}
|
||||
|
||||
/** Map a built reference to the file it names inside the dist directory. */
|
||||
function localTarget (distDir, reference) {
|
||||
return join(distDir, reference.replace(/^\.?\//, ''))
|
||||
}
|
||||
|
||||
function readDistDir (argv) {
|
||||
const known = new Set(['--help', '-h'])
|
||||
const unknown = argv.filter((argument) => {
|
||||
if (!argument.startsWith('-')) return false
|
||||
if (argument === '--dist') return false
|
||||
return !known.has(argument)
|
||||
})
|
||||
if (unknown.length > 0) throw new Error(`unknown option: ${unknown[0]}`)
|
||||
const index = argv.indexOf('--dist')
|
||||
if (index === -1) return DEFAULT_DIST_DIR
|
||||
const value = argv[index + 1]
|
||||
if (value === undefined || value.startsWith('-')) throw new Error('--dist needs a directory')
|
||||
return resolve(value)
|
||||
}
|
||||
|
||||
function digest (buffer) {
|
||||
return createHash('sha256').update(buffer).digest('hex')
|
||||
}
|
||||
|
||||
function main (argv) {
|
||||
if (argv.includes('--help') || argv.includes('-h')) {
|
||||
console.log(usage)
|
||||
return 0
|
||||
}
|
||||
|
||||
const distDir = readDistDir(argv)
|
||||
const indexPath = join(distDir, 'index.html')
|
||||
|
||||
if (!existsSync(indexPath)) {
|
||||
console.error(`generate-404: no built index at ${indexPath}`)
|
||||
console.error('generate-404: run the Vite build first, "npm run build" runs both steps.')
|
||||
return 1
|
||||
}
|
||||
|
||||
const indexBytes = readFileSync(indexPath)
|
||||
const html = indexBytes.toString('utf8')
|
||||
|
||||
if (!APP_MOUNT_RE.test(html)) {
|
||||
console.error(`generate-404: ${indexPath} has no <div id="app"> mount point`)
|
||||
console.error('generate-404: refusing to write a fallback that cannot boot the app.')
|
||||
return 1
|
||||
}
|
||||
|
||||
const references = [...new Set(
|
||||
[...html.matchAll(ASSET_ATTRIBUTE_RE)]
|
||||
.map((match) => match[1])
|
||||
.filter(isLocalReference)
|
||||
)]
|
||||
|
||||
const missing = references.filter((reference) => !existsSync(localTarget(distDir, reference)))
|
||||
if (missing.length > 0) {
|
||||
console.error(`generate-404: ${indexPath} references files that are not in the build output:`)
|
||||
for (const reference of missing) {
|
||||
console.error(` ${reference} -> ${localTarget(distDir, reference)}`)
|
||||
}
|
||||
console.error('generate-404: refusing to write a fallback that would boot a blank app.')
|
||||
return 1
|
||||
}
|
||||
|
||||
const outputPath = join(distDir, '404.html')
|
||||
const unchanged = existsSync(outputPath) && readFileSync(outputPath).equals(indexBytes)
|
||||
writeFileSync(outputPath, indexBytes)
|
||||
|
||||
console.log(`generate-404: source ${indexPath}`)
|
||||
console.log(`generate-404: output ${outputPath}`)
|
||||
console.log(`generate-404: bytes ${indexBytes.length}`)
|
||||
console.log(`generate-404: sha256 ${digest(indexBytes)}`)
|
||||
console.log(`generate-404: ${unchanged ? 'unchanged' : 'written'}`)
|
||||
console.log(`generate-404: ${references.length} local reference(s) checked in the build output:`)
|
||||
for (const reference of references) {
|
||||
console.log(` ${reference} -> ${localTarget(distDir, reference)}`)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
try {
|
||||
process.exit(main(process.argv.slice(2)))
|
||||
} catch (error) {
|
||||
console.error(`generate-404: ${error.message}`)
|
||||
console.error(usage)
|
||||
process.exit(2)
|
||||
}
|
||||
Reference in New Issue
Block a user