@thebassclef/lite 0.1.3 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/dist/cli.cjs +431 -135
  2. package/dist/cli.js +433 -137
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/lite/.bassclef-source.json +10 -0
  7. package/{substrate → dist/lite}/.claude/hooks/artifact-ingestion-gate.sh +0 -0
  8. package/{substrate → dist/lite}/.claude/hooks/assert-verify-steering.sh +0 -0
  9. package/{substrate → dist/lite}/.claude/hooks/bassclef-source-config-validate.sh +0 -0
  10. package/{substrate → dist/lite}/.claude/hooks/bassclef-sync.sh +0 -0
  11. package/{substrate → dist/lite}/.claude/hooks/compound-noun-scrub.sh +0 -0
  12. package/{substrate → dist/lite}/.claude/hooks/kiss-expansion-inject.sh +0 -0
  13. package/{substrate → dist/lite}/.claude/hooks/longrun-prep-compounding-sequence-check.sh +0 -0
  14. package/{substrate → dist/lite}/.claude/hooks/plain-english-steering.sh +0 -0
  15. package/{substrate → dist/lite}/.claude/hooks/post-skill-friction-check.sh +0 -0
  16. package/{substrate → dist/lite}/.claude/hooks/post-skill-telemetry.sh +0 -0
  17. package/{substrate → dist/lite}/.claude/hooks/pre-build-gate.sh +0 -0
  18. package/{substrate → dist/lite}/.claude/hooks/pre-commit-gate.sh +0 -0
  19. package/{substrate → dist/lite}/.claude/hooks/session-end.sh +0 -0
  20. package/{substrate → dist/lite}/.claude/hooks/session-reflection.sh +0 -0
  21. package/{substrate → dist/lite}/.claude/hooks/skill-body-grade-gate.sh +0 -0
  22. package/{substrate → dist/lite}/.claude/hooks/skill-body-intent-drift.sh +0 -0
  23. package/{substrate → dist/lite}/.claude/hooks/state-validate.sh +0 -0
  24. package/{substrate → dist/lite}/.claude/hooks/substrate-clarity-gate.sh +0 -0
  25. package/{substrate → dist/lite}/.claude/hooks/temperance-gate.sh +0 -0
  26. package/{substrate → dist/lite}/.claude/hooks/testing-tier-enforce.sh +0 -0
  27. package/{substrate → dist/lite}/.claude/hooks/turn-prose-grade-measure.sh +0 -0
  28. package/{substrate → dist/lite}/.claude/hooks/turn-prose-kiss-check.sh +0 -0
  29. package/{substrate → dist/lite}/.claude/hooks/vocabulary-migration-check.sh +0 -0
  30. package/{substrate → dist/lite}/.claude/hooks/whereami-utc-gate.sh +0 -0
  31. package/dist/lite/.claude/settings.json +212 -0
  32. package/dist/lite/CLAUDE.md +41 -0
  33. package/dist/lite/gitignore +58 -0
  34. package/dist/lite/standards/bassclef-wiring-manifest.json +497 -0
  35. package/dist/lite/whereami.md +24 -0
  36. package/package.json +8 -2
  37. package/substrate/.bassclef/lite-manifest.json +0 -2701
  38. package/substrate/.claude/agents/architect.md +0 -70
  39. package/substrate/.claude/agents/builder.md +0 -114
  40. package/substrate/.claude/agents/designer.md +0 -156
  41. package/substrate/.claude/agents/reviewer.md +0 -88
  42. package/substrate/.claude/hooks/longrun-prep-compounding-axis-check.sh +0 -492
  43. package/substrate/.claude/hooks/skill-step-list-check.sh +0 -171
  44. package/substrate/.claude/luminaries/alan-cooper.md +0 -170
  45. package/substrate/.claude/luminaries/alistair-cockburn.md +0 -140
  46. package/substrate/.claude/luminaries/amazon-pr-faq.md +0 -34
  47. package/substrate/.claude/luminaries/ash-maurya.md +0 -121
  48. package/substrate/.claude/luminaries/bill-buxton.md +0 -210
  49. package/substrate/.claude/luminaries/charles-sanders-peirce.md +0 -150
  50. package/substrate/.claude/luminaries/david-ogilvy.md +0 -192
  51. package/substrate/.claude/luminaries/don-norman.md +0 -173
  52. package/substrate/.claude/luminaries/edward-tufte.md +0 -179
  53. package/substrate/.claude/luminaries/eric-evans.md +0 -160
  54. package/substrate/.claude/luminaries/frederick-brooks.md +0 -50
  55. package/substrate/.claude/luminaries/gang-of-four.md +0 -157
  56. package/substrate/.claude/luminaries/glenford-myers.md +0 -230
  57. package/substrate/.claude/luminaries/hunt-thomas.md +0 -115
  58. package/substrate/.claude/luminaries/hyrum-wright.md +0 -94
  59. package/substrate/.claude/luminaries/jason-fried-dhh.md +0 -46
  60. package/substrate/.claude/luminaries/jesse-james-garrett.md +0 -154
  61. package/substrate/.claude/luminaries/john-ousterhout.md +0 -94
  62. package/substrate/.claude/luminaries/karl-popper.md +0 -132
  63. package/substrate/.claude/luminaries/kent-beck.md +0 -168
  64. package/substrate/.claude/luminaries/linus-torvalds.md +0 -218
  65. package/substrate/.claude/luminaries/martin-fowler.md +0 -164
  66. package/substrate/.claude/luminaries/michael-feathers.md +0 -125
  67. package/substrate/.claude/luminaries/michael-nygard.md +0 -118
  68. package/substrate/.claude/luminaries/robert-c-martin.md +0 -164
  69. package/substrate/.claude/luminaries/saltzer-schroeder.md +0 -194
  70. package/substrate/.claude/luminaries/sophia-prater.md +0 -193
  71. package/substrate/.claude/luminaries/stephen-toulmin.md +0 -131
  72. package/substrate/.claude/luminaries/tony-hoare.md +0 -170
  73. package/substrate/.claude/luminaries/vaughn-vernon.md +0 -50
  74. package/substrate/.claude/luminaries/w-edwards-deming.md +0 -158
  75. package/substrate/.claude/rules/accessor-library-discipline.md +0 -138
  76. package/substrate/.claude/rules/adr-discipline.md +0 -120
  77. package/substrate/.claude/rules/api-conventions.md +0 -125
  78. package/substrate/.claude/rules/artifact-ingestion.md +0 -179
  79. package/substrate/.claude/rules/assert-only-after-verify.md +0 -137
  80. package/substrate/.claude/rules/blocked-items.md +0 -146
  81. package/substrate/.claude/rules/bootstrap-pair-discipline.md +0 -141
  82. package/substrate/.claude/rules/branching.md +0 -28
  83. package/substrate/.claude/rules/cold-adopter-harness-discipline.md +0 -129
  84. package/substrate/.claude/rules/commit-conventions.md +0 -22
  85. package/substrate/.claude/rules/compounding-axis-fresh-analysis.md +0 -188
  86. package/substrate/.claude/rules/compounding-sequence-fresh-analysis.md +0 -188
  87. package/substrate/.claude/rules/context-engineering.md +0 -202
  88. package/substrate/.claude/rules/context-management.md +0 -85
  89. package/substrate/.claude/rules/defensive-bash.md +0 -68
  90. package/substrate/.claude/rules/deferred-actions.md +0 -233
  91. package/substrate/.claude/rules/destructive-operations.md +0 -69
  92. package/substrate/.claude/rules/diagnosis.md +0 -38
  93. package/substrate/.claude/rules/github-issue-flash-tweet.md +0 -156
  94. package/substrate/.claude/rules/guardrails.md +0 -73
  95. package/substrate/.claude/rules/hook-wire-on-author.md +0 -103
  96. package/substrate/.claude/rules/identifier-leak-prevention.md +0 -104
  97. package/substrate/.claude/rules/iteration-bet-brief-completeness.md +0 -54
  98. package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +0 -98
  99. package/substrate/.claude/rules/longrun-prep-plan-doc-compression.md +0 -89
  100. package/substrate/.claude/rules/loop-discipline.md +0 -81
  101. package/substrate/.claude/rules/manual-prod-approval.md +0 -100
  102. package/substrate/.claude/rules/marker-enrichment-discipline.md +0 -99
  103. package/substrate/.claude/rules/mobile-ephemeral-session.md +0 -109
  104. package/substrate/.claude/rules/new-dependency-check.md +0 -51
  105. package/substrate/.claude/rules/oo-ad-entry-point.md +0 -117
  106. package/substrate/.claude/rules/operator-facing-prose.md +0 -196
  107. package/substrate/.claude/rules/option-label-discipline.md +0 -108
  108. package/substrate/.claude/rules/pattern-annotation.md +0 -100
  109. package/substrate/.claude/rules/plain-english-discipline.md +0 -156
  110. package/substrate/.claude/rules/plan-enumeration-needs-value-props.md +0 -211
  111. package/substrate/.claude/rules/pr-body-shape.md +0 -317
  112. package/substrate/.claude/rules/pr-strategy.md +0 -167
  113. package/substrate/.claude/rules/pr-title-shape.md +0 -161
  114. package/substrate/.claude/rules/prototype-workflow.md +0 -65
  115. package/substrate/.claude/rules/reserved-skill-names.md +0 -123
  116. package/substrate/.claude/rules/schema-management.md +0 -49
  117. package/substrate/.claude/rules/sdlc-gates.md +0 -149
  118. package/substrate/.claude/rules/security.md +0 -37
  119. package/substrate/.claude/rules/session-artifacts.md +0 -236
  120. package/substrate/.claude/rules/skill-composition-declarations.md +0 -124
  121. package/substrate/.claude/rules/skill-description-clarity.md +0 -247
  122. package/substrate/.claude/rules/skill-procedure-step-list.md +0 -137
  123. package/substrate/.claude/rules/state-schema-validation.md +0 -162
  124. package/substrate/.claude/rules/stuck-signal-diagnostic.md +0 -140
  125. package/substrate/.claude/rules/substrate-config-schema.md +0 -98
  126. package/substrate/.claude/rules/test-list-discipline.md +0 -175
  127. package/substrate/.claude/rules/test-sufficiency.md +0 -210
  128. package/substrate/.claude/rules/testing-tier-config.md +0 -145
  129. package/substrate/.claude/rules/testing.md +0 -38
  130. package/substrate/.claude/rules/turn-estimate-grounding.md +0 -134
  131. package/substrate/.claude/rules/visual-hierarchy.md +0 -437
  132. package/substrate/.claude/rules/we-dont-break-adopters.md +0 -126
  133. package/substrate/.claude/rules/whereami-load-bearing.md +0 -202
  134. package/substrate/.claude/rules/writing-craft-discipline.md +0 -92
  135. package/substrate/.claude/rules/wu-sequencing-compounds.md +0 -145
  136. package/substrate/.claude/skills/build/SKILL.md +0 -640
  137. package/substrate/.claude/skills/chronicle/SKILL.md +0 -55
  138. package/substrate/.claude/skills/clean-artifacts/SKILL.md +0 -249
  139. package/substrate/.claude/skills/decompose/SKILL.md +0 -280
  140. package/substrate/.claude/skills/diagnose/SKILL.md +0 -297
  141. package/substrate/.claude/skills/feynman/SKILL.md +0 -90
  142. package/substrate/.claude/skills/howdoi/SKILL.md +0 -105
  143. package/substrate/.claude/skills/ia-model/SKILL.md +0 -108
  144. package/substrate/.claude/skills/interaction-design/SKILL.md +0 -112
  145. package/substrate/.claude/skills/interpret-input/SKILL.md +0 -180
  146. package/substrate/.claude/skills/journal/SKILL.md +0 -209
  147. package/substrate/.claude/skills/kiss/SKILL.md +0 -449
  148. package/substrate/.claude/skills/launch/SKILL.md +0 -915
  149. package/substrate/.claude/skills/lean-canvas/SKILL.md +0 -332
  150. package/substrate/.claude/skills/longrun/SKILL.md +0 -463
  151. package/substrate/.claude/skills/luminary/SKILL.md +0 -481
  152. package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +0 -177
  153. package/substrate/.claude/skills/onboard-repo/SKILL.md +0 -1624
  154. package/substrate/.claude/skills/pattern-review/SKILL.md +0 -99
  155. package/substrate/.claude/skills/personas/SKILL.md +0 -207
  156. package/substrate/.claude/skills/promote/SKILL.md +0 -283
  157. package/substrate/.claude/skills/requirement/SKILL.md +0 -98
  158. package/substrate/.claude/skills/retro/SKILL.md +0 -117
  159. package/substrate/.claude/skills/riff/SKILL.md +0 -114
  160. package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +0 -163
  161. package/substrate/.claude/skills/session-end/SKILL.md +0 -309
  162. package/substrate/.claude/skills/session-log/SKILL.md +0 -299
  163. package/substrate/.claude/skills/skills/SKILL.md +0 -228
  164. package/substrate/.claude/skills/spec/SKILL.md +0 -105
  165. package/substrate/.claude/skills/sprint/SKILL.md +0 -392
  166. package/substrate/.claude/skills/stage/SKILL.md +0 -384
  167. package/substrate/.claude/skills/state-a-problem/SKILL.md +0 -185
  168. package/substrate/.claude/skills/temperance/SKILL.md +0 -108
  169. package/substrate/.claude/skills/use-case/SKILL.md +0 -417
  170. package/substrate/.claude/skills/user-stories/SKILL.md +0 -268
  171. package/substrate/.claude/skills/value-prop/SKILL.md +0 -251
  172. package/substrate/.claude/skills/verify/SKILL.md +0 -160
  173. package/substrate/.claude/skills/visual-review/SKILL.md +0 -503
  174. package/substrate/.claude/skills/whats-the-plan/SKILL.md +0 -202
  175. package/substrate/.claude/skills/whereami/SKILL.md +0 -307
  176. package/substrate/AGENTS.md +0 -79
  177. package/substrate/CLAUDE-lite.md +0 -85
  178. package/substrate/CODE_OF_CONDUCT.md +0 -28
  179. package/substrate/CONTRIBUTING.md +0 -177
  180. package/substrate/README.md +0 -173
  181. package/substrate/SECURITY.md +0 -19
  182. package/substrate/architecture/decisions/ADR-029-release-pipeline.md +0 -79
  183. package/substrate/architecture/decisions/ADR-031-non-breaking-changes-adopter-discipline.md +0 -139
  184. package/substrate/architecture/decisions/ADR-032-adopter-sync-dispatcher-architecture.md +0 -192
  185. package/substrate/architecture/decisions/ADR-039-release-tagging-scheme.md +0 -145
  186. package/substrate/architecture/decisions/ADR-040-planning-skill-vocabulary-and-lite-profile.md +0 -155
  187. package/substrate/architecture/decisions/ADR-044-unified-skill-body-template.md +0 -162
  188. package/substrate/lib/clean-artifacts-sweep.sh +0 -112
  189. package/substrate/lib/code-comment-discipline.sh +0 -144
  190. package/substrate/lib/composer-preflight.sh +0 -459
  191. package/substrate/lib/hook-inject.sh +0 -255
  192. package/substrate/lib/luminary-pick.sh +0 -96
  193. package/substrate/lib/output-discipline.sh +0 -143
  194. package/substrate/lib/prose-scan-boundary.sh +0 -171
  195. package/substrate/lib/rewrite-check.sh +0 -214
  196. package/substrate/lib/state.sh +0 -1372
  197. package/substrate/lib/telemetry.sh +0 -205
  198. package/substrate/lib/tier-check.sh +0 -187
  199. package/substrate/lib/tier-dependency-audit.sh +0 -1088
  200. package/substrate/presence/install/bassclef-hook-connect.sh +0 -178
  201. package/substrate/presence/install/bassclef-sync.dispatcher.template.sh +0 -841
  202. package/substrate/presence/install/bassclef-sync.template.sh +0 -2076
  203. package/substrate/presence/install/schedule-auto-save.cron.sh +0 -88
  204. package/substrate/presence/install/schedule-auto-save.taskscheduler.md +0 -122
  205. package/substrate/scripts/aggregate-telemetry.sh +0 -217
  206. package/substrate/scripts/analyze-tier-dependencies.sh +0 -239
  207. package/substrate/scripts/generate-lite-manifest.sh +0 -505
  208. package/substrate/scripts/generate-tier-manifest.sh +0 -28
  209. package/substrate/scripts/intent-drift-check.sh +0 -456
  210. package/substrate/scripts/lite-manifest-drift-check.sh +0 -146
  211. package/substrate/scripts/render-lite-manifest-doc.sh +0 -150
  212. package/substrate/standards/adr-template.md +0 -86
  213. package/substrate/standards/api-conventions/nextjs.md +0 -84
  214. package/substrate/standards/artifact-composition.md +0 -209
  215. package/substrate/standards/bash-hook-safety.md +0 -246
  216. package/substrate/standards/bassclef-configs-schema.md +0 -232
  217. package/substrate/standards/bassclef-evolution.md +0 -143
  218. package/substrate/standards/bassclef-internal-jargon.md +0 -244
  219. package/substrate/standards/bassclef-managed-sentinel.md +0 -96
  220. package/substrate/standards/bassclef-source-config.md +0 -228
  221. package/substrate/standards/branch-stacking.md +0 -408
  222. package/substrate/standards/code-safety-principles.md +0 -176
  223. package/substrate/standards/composer-prerequisites.md +0 -155
  224. package/substrate/standards/deferred-actions-schema.md +0 -204
  225. package/substrate/standards/dependency-discipline/cargo.md +0 -39
  226. package/substrate/standards/dependency-discipline/gem.md +0 -43
  227. package/substrate/standards/dependency-discipline/go-mod.md +0 -41
  228. package/substrate/standards/dependency-discipline/npm.md +0 -42
  229. package/substrate/standards/dependency-discipline/pip.md +0 -42
  230. package/substrate/standards/deployment-topology/ec2-tailscale.md +0 -225
  231. package/substrate/standards/deployment-topology.md +0 -69
  232. package/substrate/standards/docs-sync-allowlist.md +0 -76
  233. package/substrate/standards/domain-and-dns.md +0 -145
  234. package/substrate/standards/frontend-stack.md +0 -67
  235. package/substrate/standards/frontmatter-schema.md +0 -154
  236. package/substrate/standards/graceful-exit.md +0 -227
  237. package/substrate/standards/hook-idempotency.md +0 -102
  238. package/substrate/standards/hook-injection-discipline.md +0 -202
  239. package/substrate/standards/hook-install-class.md +0 -215
  240. package/substrate/standards/input-handler-interface.md +0 -152
  241. package/substrate/standards/lite-manifest-schema-changes.md +0 -135
  242. package/substrate/standards/luminary-matching.md +0 -105
  243. package/substrate/standards/luminary-problem-patterns.md +0 -481
  244. package/substrate/standards/migration-discipline/active-record.md +0 -50
  245. package/substrate/standards/migration-discipline/alembic.md +0 -43
  246. package/substrate/standards/migration-discipline/gorm.md +0 -50
  247. package/substrate/standards/migration-discipline/prisma.md +0 -53
  248. package/substrate/standards/migration-discipline/sqlalchemy.md +0 -51
  249. package/substrate/standards/mobile-ephemeral-session.md +0 -167
  250. package/substrate/standards/model-routing-discipline.md +0 -160
  251. package/substrate/standards/ogilvy-writing-rules.md +0 -225
  252. package/substrate/standards/opener-discipline.md +0 -96
  253. package/substrate/standards/operator-facing-prose-discipline.md +0 -201
  254. package/substrate/standards/persona-schema.md +0 -229
  255. package/substrate/standards/pluggable-luminaries.md +0 -323
  256. package/substrate/standards/pr-body-discipline.md +0 -115
  257. package/substrate/standards/preview-state-schema.md +0 -189
  258. package/substrate/standards/project-directory-layout.md +0 -276
  259. package/substrate/standards/release-tagging.md +0 -137
  260. package/substrate/standards/reserved-skill-names.md +0 -120
  261. package/substrate/standards/scannable-multi-option-output.md +0 -261
  262. package/substrate/standards/sdlc-compliance.md +0 -286
  263. package/substrate/standards/sdlc-gates/typescript.md +0 -57
  264. package/substrate/standards/secrets-lifecycle.md +0 -210
  265. package/substrate/standards/security-scanner-adapter.md +0 -145
  266. package/substrate/standards/session-board.md +0 -256
  267. package/substrate/standards/skill-output-discipline.md +0 -90
  268. package/substrate/standards/state-spine-contract.md +0 -255
  269. package/substrate/standards/state-spine.md +0 -511
  270. package/substrate/standards/steering-hints/kiss-words.md +0 -11
  271. package/substrate/standards/substrate-config-schema.md +0 -267
  272. package/substrate/standards/tech-stack-config.md +0 -109
  273. package/substrate/standards/tier-dependency-analysis.md +0 -167
  274. package/substrate/standards/tier-runtime-deps/lite.md +0 -57
  275. package/substrate/standards/tier-tag-schema.md +0 -155
  276. package/substrate/standards/two-layer-config.md +0 -99
  277. package/substrate/standards/use-case-format.md +0 -292
  278. package/substrate/standards/user-story-invest.md +0 -268
  279. package/substrate/standards/velocity-and-appetite.md +0 -229
  280. package/substrate/standards/voice-input-pattern.md +0 -119
  281. package/substrate/standards/whereami-schema.md +0 -301
  282. package/substrate/standards/worktree-management.md +0 -211
  283. package/substrate/standards/writing-guide.md +0 -213
  284. package/substrate/templates/chronicle-template.md +0 -75
  285. package/substrate/templates/deferred-action-template.md +0 -45
  286. package/substrate/templates/memory-proposal-template.md +0 -77
  287. package/substrate/templates/persona-template.md +0 -200
  288. package/substrate/templates/pr-faq.md +0 -45
  289. package/substrate/templates/secret-rotation-template.md +0 -162
  290. package/substrate/templates/spec-template.md +0 -131
  291. package/substrate/templates/use-case-template.md +0 -194
  292. package/substrate/templates/user-story-template.md +0 -107
  293. package/substrate/templates/whereami-template.md +0 -101
@@ -1,214 +0,0 @@
1
- #!/bin/bash
2
- # tier: lite
3
- # rewrite-check.sh — six heuristic checks for /kiss REWRITE mode (goal 25d Step 5).
4
- #
5
- # Grounded in four public sources:
6
- # - UK ONS Style Guide — Plain English section
7
- # - Nielsen Norman Group — Plain Language for Experts (2018)
8
- # - US Federal Plain Language Guidelines (plainlanguage.gov)
9
- # - Hemingway Editor heuristics (public rules — passive, adverbs, long sentences)
10
- #
11
- # The six checks are HEURISTIC not perfect NLP. They surface CANDIDATES for
12
- # human review. Not a gate. Not a blocking check. Exit 0 always.
13
- #
14
- # Sister to lib/output-discipline.sh (classifier for /kiss dispatch presence)
15
- # and lib/code-comment-discipline.sh (classifier for header comment jargon).
16
- # Same Ousterhout deep-module shape — small interface, shared implementation.
17
- #
18
- # Per bassclef-upstream#859 Iteration D + goal 25d Step 5.
19
- # Bash 3.2+ compatible.
20
- #
21
- # Usage — sourced by /kiss words --rewrite mode:
22
- # source lib/rewrite-check.sh
23
- # check_passive_voice <file> # prints lines with passive-voice patterns
24
- # check_hyphen_words <file> # prints hyphenated compound words flagged
25
- # check_sentence_length <file> [N] # prints sentences over N words (default 25)
26
- # check_svo <file> # prints sentences NOT starting with subject
27
- # check_noun_stack <file> # prints 3+ noun runs without verb
28
- # check_adverb_density <file> # prints density note if >5% -ly adverbs
29
- # run_rewrite_checks <file> # runs all six; prints findings table
30
-
31
- set -o pipefail
32
-
33
- # === Standard tech hyphens allow-list ===
34
- # Common tech compound words that should NOT be flagged as jargon.
35
- # Grep-alternation shape (pipe-separated).
36
- REWRITE_TECH_HYPHENS='pre-commit|pre-push|post-commit|post-push|real-time|data-driven|end-to-end|non-blocking|read-only|copy-on-write|test-driven|type-safe|open-source|self-hosted|cross-platform|multi-tenant|single-tenant|full-stack|front-end|back-end|no-op|no-code|low-code|check-in|check-out|log-in|log-out|sign-in|sign-out|drop-down|pop-up|pull-request|merge-request|feature-branch|main-branch|no-fast-forward|off-the-shelf|out-of-the-box'
37
-
38
- # === Passive voice check ===
39
- # Pattern per Hemingway Editor: "to be" + past participle + optional "by".
40
- # Common shapes:
41
- # was <verb-ed> by
42
- # were <verb-ed> by
43
- # has been <verb-ed>
44
- # have been <verb-ed>
45
- # had been <verb-ed>
46
- # is being <verb-ed>
47
- # was <verb-ed>
48
- # Returns matching lines. Exit 0 always.
49
- check_passive_voice() {
50
- local file="$1"
51
- [ -f "$file" ] || return 0
52
- grep -niE '\b(was|were|has been|have been|had been|is being|are being|will be) [a-z]+(ed|en) (by|to)\b|\b(was|were|has been|have been|had been) [a-z]+(ed|en)\b' "$file" 2>/dev/null
53
- return 0
54
- }
55
-
56
- # === Hyphen-word check ===
57
- # Flag hyphenated compounds that are NOT in the standard tech allow-list.
58
- # Per operator-facing-prose.md — hyphen words like X-side, N-layer X, X-as-Y
59
- # should be rewritten to plain description.
60
- check_hyphen_words() {
61
- local file="$1"
62
- [ -f "$file" ] || return 0
63
- # Extract hyphenated words (letters-letters); filter to those NOT in the allow-list
64
- # AND that look like adjective compounds (letters-letters where both parts are 2+ chars).
65
- grep -oE '\b[a-z]{2,}-[a-z]{2,}\b' "$file" 2>/dev/null \
66
- | sort -u \
67
- | grep -vwE "$REWRITE_TECH_HYPHENS" \
68
- | head -20
69
- return 0
70
- }
71
-
72
- # === Sentence length check ===
73
- # Flag sentences over N words (default 25 per Hemingway + Federal Plain
74
- # Language recommendation). Very-long sentences (>30) get the strong flag.
75
- check_sentence_length() {
76
- local file="$1"
77
- local ceiling="${2:-25}"
78
- [ -f "$file" ] || return 0
79
- # Split on sentence-ending punctuation, count words per sentence.
80
- # awk splits, counts words, flags any over ceiling.
81
- awk -v CEIL="$ceiling" '
82
- BEGIN { RS = "[.!?][[:space:]]+" }
83
- {
84
- # Count words (whitespace-separated tokens)
85
- n = split($0, words, /[[:space:]]+/)
86
- if (n > CEIL) {
87
- # Trim + print first 60 chars for context
88
- sample = substr($0, 1, 60)
89
- gsub(/\n/, " ", sample)
90
- printf "SENTENCE: %d words — %s...\n", n, sample
91
- }
92
- }
93
- ' "$file" 2>/dev/null
94
- return 0
95
- }
96
-
97
- # === SVO check ===
98
- # Heuristic: flag sentences that START with a preposition or subordinating
99
- # conjunction rather than a subject. Common non-SVO openers:
100
- # Because, Although, While, When, If, Since, Unless, Whereas, After, Before
101
- # In X, On X, At X, With X, Under X, Without X, Despite X, Given X
102
- # This catches the most common non-SVO shapes. False positives happen on
103
- # legitimate variety; the check surfaces candidates for review.
104
- check_svo() {
105
- local file="$1"
106
- [ -f "$file" ] || return 0
107
- # Grep for lines starting with (after optional whitespace/quote) a non-SVO opener.
108
- grep -niE '^[[:space:]]*(Because|Although|While|When|If|Since|Unless|Whereas|After|Before|In [A-Z]|On [A-Z]|At [A-Z]|With [A-Z]|Under [A-Z]|Without [A-Z]|Despite|Given)\b' "$file" 2>/dev/null
109
- return 0
110
- }
111
-
112
- # === Noun-stack check ===
113
- # Per operator-facing-prose.md: no more than 2 nouns in a row without a verb.
114
- # Heuristic: look for 3+ consecutive words that end in common noun suffixes
115
- # OR that are capitalized (proper nouns). Approximate.
116
- #
117
- # The heuristic flags runs of 3+ words that look like nouns (no verb-form
118
- # suffix like -ed, -ing, -es, -s at verb pattern). Bash regex is limited;
119
- # we use a simple approximation:
120
- # - 3+ consecutive words each 4+ chars long
121
- # - none ending in -ed, -ing, -ly, -s (verb / adverb / plural marker)
122
- # - separated by single space (not by "the", "a", "an", "and", "or", "of")
123
- # Approximation: words separated only by spaces (no articles/verbs between).
124
- check_noun_stack() {
125
- local file="$1"
126
- [ -f "$file" ] || return 0
127
- # Simple heuristic: match "word word word word" with no small connector.
128
- # Look for runs of 4+ non-tiny words in a row.
129
- awk '
130
- {
131
- # Split into words, find runs of 3+ nouny-looking tokens
132
- n = split($0, w, /[[:space:]]+/)
133
- run = 0
134
- run_words = ""
135
- for (i = 1; i <= n; i++) {
136
- word = w[i]
137
- # Strip punctuation for the check
138
- clean = word
139
- gsub(/[^A-Za-z]/, "", clean)
140
- # Nouny heuristic: 4+ chars, not a verb/adverb marker, not a small word
141
- if (length(clean) >= 4 \
142
- && clean !~ /^(the|and|for|with|from|that|this|when|where|which|been|were|have|will|would|could|should|about|because|through|these|those)$/ \
143
- && clean !~ /(ing|ed|ly)$/) {
144
- run++
145
- run_words = run_words " " clean
146
- } else {
147
- if (run >= 3) {
148
- printf "NOUN-STACK: %d nouns —%s\n", run, run_words
149
- }
150
- run = 0
151
- run_words = ""
152
- }
153
- }
154
- if (run >= 3) {
155
- printf "NOUN-STACK: %d nouns —%s\n", run, run_words
156
- }
157
- }
158
- ' "$file" 2>/dev/null
159
- return 0
160
- }
161
-
162
- # === Adverb density check ===
163
- # Per Hemingway Editor: -ly adverbs above 1 per 20 words signal weak verbs.
164
- # Federal Plain Language: prefer strong verbs over adverbs.
165
- # Threshold: >5% (equivalent to 1 per 20 words).
166
- check_adverb_density() {
167
- local file="$1"
168
- [ -f "$file" ] || return 0
169
- local total_words adverb_count percent
170
- # Count total words
171
- total_words=$(tr -s '[:space:]' '\n' < "$file" | grep -cE '^[A-Za-z]+' 2>/dev/null || echo 0)
172
- # Count -ly adverbs (word ending -ly, excluding common -ly words that aren't adverbs)
173
- adverb_count=$(grep -oiE '\b[a-z]{3,}ly\b' "$file" 2>/dev/null \
174
- | grep -viwE 'only|early|ally|belly|silly|fully|jolly|holy|really|apply|comply|imply|reply|supply|family|reply' \
175
- | wc -l | tr -d ' ')
176
- if [ "$total_words" -eq 0 ]; then
177
- return 0
178
- fi
179
- # Compute percent (integer math * 1000 for one decimal)
180
- percent=$((adverb_count * 1000 / total_words))
181
- # Threshold: 50 = 5.0%
182
- if [ "$percent" -gt 50 ]; then
183
- printf "ADVERB density: %d/%d words = %d.%d%%\n" \
184
- "$adverb_count" "$total_words" "$((percent / 10))" "$((percent % 10))"
185
- fi
186
- return 0
187
- }
188
-
189
- # === Composite check ===
190
- # Runs all six checks against a file. Prints a findings table.
191
- # Exit 0 always (informational, not a gate).
192
- run_rewrite_checks() {
193
- local file="$1"
194
- [ -f "$file" ] || return 0
195
- local passive hyphens length svo nouns adverbs
196
- passive=$(check_passive_voice "$file")
197
- hyphens=$(check_hyphen_words "$file")
198
- length=$(check_sentence_length "$file")
199
- svo=$(check_svo "$file")
200
- nouns=$(check_noun_stack "$file")
201
- adverbs=$(check_adverb_density "$file")
202
-
203
- echo "=== REWRITE check findings: $file ==="
204
- [ -n "$passive" ] && { echo "-- passive voice --"; echo "$passive"; }
205
- [ -n "$hyphens" ] && { echo "-- hyphen compounds --"; echo "$hyphens"; }
206
- [ -n "$length" ] && { echo "-- long sentences --"; echo "$length"; }
207
- [ -n "$svo" ] && { echo "-- non-SVO openers --"; echo "$svo"; }
208
- [ -n "$nouns" ] && { echo "-- noun stacks --"; echo "$nouns"; }
209
- [ -n "$adverbs" ] && { echo "-- adverb density --"; echo "$adverbs"; }
210
- if [ -z "$passive$hyphens$length$svo$nouns$adverbs" ]; then
211
- echo "CLEAN — no rewrite findings"
212
- fi
213
- return 0
214
- }