rhachet-roles-ehmpathy 1.13.6 → 1.13.7
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.
- package/dist/logic/roles/architect/.briefs/criteria.given_when_then.[seed].v3.md +87 -0
- package/dist/logic/roles/architect/.briefs/practices/prefer.env_access.prep_over_dev.md +12 -0
- package/dist/logic/roles/architect/.briefs/ubiqlang.ambiguous-from-overload.md +1 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog000.overview.and.premise.md +115 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.coordinates.spherical.md +69 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.metaphor.cauliflorous.md +44 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.metaphor.galactic_spacetravel.[article].md +42 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.metaphor.galactic_spacetravel.[lesson].md +60 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.structs.catalog.md +51 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.structs.treestruct.md +85 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog021.structs.vector.md +112 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.definition.md +115 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct._.md +112 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.coords.1.spherical.md +80 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.coords.2.abstractive.md +59 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.coords.3.descriptive.md +64 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.1.perspectives.md +88 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.2.universal.md +82 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.3.relative.md +106 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog101.concept.treestruct.persp.4.fractal.md +83 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog151.concept.treestruct.gravity.md +89 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog201.cortal.focus.p1.definition.md +231 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog201.cortal.focus.p1.examples.cont.md +82 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog201.cortal.focus.p2.acuity.md +134 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog201.cortal.focus.p2.breadth.md +151 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog201.cortal.focus.p2.depth.md +147 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog251.cortal.focus.p3.fabric.md +96 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog251.cortal.focus.p3.mode.md +68 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog251.cortal.focus.p3.rythm.md +56 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog251.cortal.focus.p3.usecases.md +76 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog301.traversal.1.motion.primitives._.md +155 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog301.traversal.1.motion.primitives.acuity.md +94 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog301.traversal.1.motion.primitives.breadth.md +114 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog301.traversal.1.motion.primitives.breadth.vary.md +105 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog301.traversal.1.motion.primitives.depth.md +132 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog301.traversal.2.motion.composites._.md +106 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog301.traversal.2.motion.composites.grammar.md +105 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.._.md +209 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.1.persp.as.berries.md +168 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.1.persp.as.vectors.md +74 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.1.persp.has.precision.tunable.md +80 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.2.1.primitives.rough._.md +99 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.2.1.primitives.rough.interrogative.md +108 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.2.1.primitives.rough.why.[article].md +55 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.2.2.composite.smooth._.md +83 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog401.questions.2.2.composite.smooth.examples.md +101 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang.1.primitives._.md +134 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang.1.primitives.recall.md +149 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang.1.primitives.steer.md +146 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang.1.primitives.think.md +141 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang.2.composites.zoom.md +127 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang.3.catalogs.md +107 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang.3.grammar.md +124 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/cog501.cortal.assemblylang_.md +0 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/inflight/concept.vs.idea.md +70 -0
- package/dist/logic/roles/bhrain/.briefs/cognition/inflight/core.concept.adjectives.md +8 -0
- package/dist/logic/roles/bhrain/.briefs/distilisys.grammar.compressed.md +19 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.1.why.common.[article].md +32 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.1.why.term_smells.[article].md +36 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.1.why.term_smells.detection.[lesson].md +73 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.2.tactic.eliminate.[article].md +55 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.2.tactic.eliminate.[lesson].md +41 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait]._.md +66 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait].balance.md +36 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait].bane.md +34 -0
- package/dist/logic/roles/bhrain/.briefs/grammar/gerunds.3.eliminator.[trait].boon.md +35 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno101.primitives.1.ontology.[article].frame.docs_as_materializations.md +63 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno101.primitives.1.ontology.[article].frame.docs_as_references.md +45 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno101.primitives.2.rel.many_to_many.[article].md +37 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno101.primitives.3.instances.[article].md +39 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno101.primitives.4.documents.[article].md +37 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno101.primitives.5.concepts.[article].md +39 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno201.documents._.[article].md +48 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno201.documents._.[catalog].md +52 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno201.documents.articles.[article].md +40 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno201.documents.catalogs.[article].md +41 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno201.documents.demos.[article].md +42 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno201.documents.lessons.[article].md +42 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.compression.1.refs._.[article].md +41 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.compression.2.kernels._.[article].i1.md +50 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.compression.3.briefs._.[article].md +40 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.compression._.[article].md +90 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.compression._.[catalog].persp.garden.md +64 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[article].md +45 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[demo].algorithm.md +54 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[demo].color.md +56 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[demo].empathy.md +54 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[demo].entropy.md +54 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[demo].gravity.md +54 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[demo].joke.md +56 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.1.from_instances.[demo].value.md +54 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2._.[catalog].md +43 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.articulate.[article].md +27 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.articulate.[lesson].md +49 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.catalogize.[article].md +27 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.catalogize.[lesson].md +54 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.demonstrate.[article].md +26 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.demonstrate.[lesson].md +49 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.lessonize.[article].md +26 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.enbrief.2.lessonize.[lesson].md +54 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.kernelize._.[article].md +58 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno301.doc.kernelize._.[lesson].md +88 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno351.docs.are_instances.[article].md +34 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno351.docs.recursion.[catalog].md +44 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno401.actors.1.role.author.[article].md +36 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno401.actors.1.role.librarian.[article].md +40 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno401.actors.2.interdependence.[article].md +52 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno501.doc.enbrief.catalog.structure1.[article].md +53 -0
- package/dist/logic/roles/bhrain/.briefs/knowledge/kno501.doc.enbrief.catalog.structure1.[lesson].template.md +101 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/article.variant.vision.[article].md +60 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/term.expectation.vs_assumption._.md +60 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/term.frame.vs_perspective.[article].md +96 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/term.invariant.[article].md +29 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/term.lesson._vs_article.[article].md +36 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/term.ref._vs_brief.md +90 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/term.referent.[article].md +43 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/usage.lesson_vs_article.[lesson].md +31 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.context/usage.lesson_vs_article_vs_demo.[lesson].md +37 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/.readme.md +12 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>._.[article].frame.cognitive.md +33 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>._.[article].frame.tactical.md +45 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tactic.[catalog].md +83 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tactic.concept_dimension.examples.[article][seed].md +4 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tactic.concept_dimension.invariants.[article].md +36 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tactic.from.examples.md +44 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tactic.from.seed.md +48 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tactic.with.templates.[article].md +57 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tactic.with.templates.[gallery][review].effective.md +1 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<articulate>.tone.bluecollar.[article][seed].md +5 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<catalogize>._.[article][seed].md +3 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<catalogize>.observation.via_clusterage_over_via_imagination.[seed].md +6 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<catalogize>.vs_diverge.[article].persp.save_compute.md +46 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>._.[article].frame.colloquial.i2.by_grok.md +64 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.[catalog].md +106 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.contrast.[demo].usecase.vs_userjourney.by_chatgpt.md +45 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.counter.[demo].usecase.flyer.by_chargpt.md +38 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.counter.[demo].walkability.phoenix.by_chargpt.md +41 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.[demo].shear_force.scissors.by_grok.md +52 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.[demo].tea.darjeeling.by_grok.md +50 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.[demo].usecase.book_flight.by_grok.md +54 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.[demo].usecase.order_food.by_chatgpt.md +40 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.[demo].walkability.portland.by_chatgpt.i3.md +42 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.[demo].walkability.portland.by_grok.i2.md +49 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.[lesson].howto.md +28 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.example.structure.[article].i2.md +73 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.narrative.[demo].usecase.order_online.by_chatgpt.md +34 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/<demonstrate>.variants.walkthrough.[demo].usecase.book_online.by_chatgpt.md +47 -0
- package/dist/logic/roles/bhrain/.briefs/librarian.tactics/[brief].verbiage.outline.over.narrative.md +55 -0
- package/dist/logic/roles/bhrain/.briefs/logistics/term.logistics.[article].md +21 -0
- package/dist/logic/roles/bhrain/.briefs/logistics/term.logistics.of_information.[article].md +22 -0
- package/dist/logic/roles/bhrain/.briefs/logistics/term.logistics.of_knowledge.[article].md +29 -0
- package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.acuity.md +77 -0
- package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.breadth.md +74 -0
- package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.depth.md +77 -0
- package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.distance.md +92 -0
- package/dist/logic/roles/bhrain/.briefs/physics/optics.focal.tradeoffs.md +107 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/tactics.compose.traits_and_skills.[article].md +76 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.articulation.[article].md +67 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.purpose.[article].md +56 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.vs_skill.[article].md +55 -0
- package/dist/logic/roles/bhrain/.briefs/tactician/trait.vs_tactic.[article].md +70 -0
- package/dist/logic/roles/bhrain/.briefs/terms.motive.intent.goal.md +46 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<cluster>._.[article].frame.tactical._.md +85 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<cluster>.vs_<diverge>.duality.[article].md +43 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<diverge>._.[article].frame.cognitive.[seed].md +4 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<diverge>._.[article].frame.tactical.md +89 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<elaborate>_vs_<elucidate>.[seed].md +1 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<enquestion>._.[article].md +113 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<enquestion>._.[gallery].plumber.diagnose.md +130 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<enquestion>._.[gallery].thinker.enquestion.md +125 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<enquestion>.tactic.perspectives.[article].md +36 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<triage>._.[article].frame.tactical.md +85 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<triage>.persp.grades_from_context.[article].md +48 -0
- package/dist/logic/roles/bhrain/.briefs/thinker.tactics/<triage>.persp.implicit_question.[article].md +65 -0
- package/dist/logic/roles/bhrain/.briefs/trait.chillnature.md +14 -0
- package/dist/logic/roles/bhrain/.briefs/trait.ocd.md +5 -0
- package/dist/logic/roles/bhrain/.briefs/worders/core.matmuls_vecmuls_elemuls.md +93 -0
- package/dist/logic/roles/bhrain/.briefs/worders/core.transformers.as_origin.md +62 -0
- package/dist/logic/roles/bhrain/.briefs/worders/core.transformers.self_attention.[article].md +93 -0
- package/dist/logic/roles/bhrain/.briefs/worders/core.transformers.self_attention.[demo].ambig.bank.md +80 -0
- package/dist/logic/roles/bhrain/.briefs/worders/core.transformers.self_attention.[demo].cat_sat.md +67 -0
- package/dist/logic/roles/bhrain/.briefs/worders/force.repeat_input_structures.md +48 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.interdependence.[article].md +37 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.interdependence.[demo].domain.physics.md +30 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.internal_vs_external.[article].artist_vs_librarian.md +44 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.internal_vs_external.[demo].artist_vs_librarian.md +37 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.internal_vs_external.[demo].domain.physics.md +39 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.internalized.[article].md +35 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.internalized.[demo].artist.md +36 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.internalized.[demo].neural.md +37 -0
- package/dist/logic/roles/bhrain/.briefs/worders/knowledge.internalized.[demo].pianist.md +34 -0
- package/dist/logic/roles/bhrain/.briefs/worders/limits.rhyme.md +46 -0
- package/dist/logic/roles/bhrain/.briefs/worders/limits.spell.md +49 -0
- package/dist/logic/roles/bhrain/.briefs/worders/teach.via.library.examples.md +28 -0
- package/dist/logic/roles/bhrain/.briefs/worders/teach.via.library.explanations_vs_examples.md +40 -0
- package/dist/logic/roles/bhrain/.briefs/worders/trend.prefer_reuse.[seed].md +10 -0
- package/dist/logic/roles/bhrain/brief.articulate/stepArticulate.template.md +120 -0
- package/dist/logic/roles/bhrain/brief.demonstrate/stepDemonstrate.template.md +135 -0
- package/dist/logic/roles/bhrain/khue.cluster/stepCluster.template.md +134 -0
- package/dist/logic/roles/bhrain/khue.diverge/stepDiverge.template.md +110 -0
- package/dist/logic/roles/bhrain/khue.instantiate/stepInstantiate.template.md +73 -0
- package/dist/logic/roles/bhrain/khue.triage/stepTriage.template.md +128 -0
- package/dist/logic/roles/coach/.briefs/claude.context-caching.md +76 -0
- package/dist/logic/roles/designer/.briefs/declarative-over-imperative.md +79 -0
- package/dist/logic/roles/designer/.briefs/declarative-over-imperative.stub.md +14 -0
- package/dist/logic/roles/designer/.briefs/pit-of-success.md +70 -0
- package/dist/logic/roles/designer/.briefs/pit-of-success.stub.md +3 -0
- package/dist/logic/roles/designer/outlineDistilisys/stepOutlineDistilisys.template.md +173 -0
- package/dist/logic/roles/designer/outlineRoadmap/stepOutlineRoadmap.template.md +88 -0
- package/dist/logic/roles/designer/outlineVision/stepOutlineVision.template.md +47 -0
- package/dist/logic/roles/ecologist/.briefs/.readme.md +17 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys101.distilisys.grammar.md +221 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive._.summary.md +82 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p1.reversibility.entropy.md +39 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p2.option.chance.choice.md +140 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p3.chance.motive.polarity.threat.md +72 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p4.motive.horizon.md +101 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys201.actor.motive.p5.motive.grammar.md +131 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources._.primitives.summary.md +108 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt1.primitive.time.md +56 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt2.primitive.energy.md +69 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt3.primitive.space.md +85 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt4.primitive.claim.md +113 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys211.actor.resources.pt5.composites.md +146 -0
- package/dist/logic/roles/ecologist/.briefs/distilisys/sys231.actor.claims.p1.primitive.exchange.md +130 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/.eco001.origin.prompt.md +11 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/eco001.overview.md +44 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/eco101.core-system-understanding.md +70 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p1.ecosystem-structure.md +62 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p2.trophic-dynamics.md +59 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p3.population-ecology.md +71 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/eco101.p4.community-interactions.md +78 -0
- package/dist/logic/roles/ecologist/.briefs/ecology/eco505.systems-thinking.md +62 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ001.overview.md +65 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ101.core-mechanics.md +65 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ101.p1.supply-and-demand.md +76 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ101.p2.opportunity-cost.md +106 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ101.p3.marginal-analysis.md +79 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ101.p4.rational-choice.md +81 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ201.market-structures-and-failures.md +81 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ301.production-and-growth.md +71 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ401.macro-systems.md +92 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ501.global-and-institutional.md +85 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ501.p1.game-theory.md +142 -0
- package/dist/logic/roles/ecologist/.briefs/economy/econ501.p4.behavioral-economics.md +146 -0
- package/dist/logic/roles/ecologist/.briefs/product/user.journey._.[article].i1.md +68 -0
- package/dist/logic/roles/ecologist/.briefs/product/user.journey._.[article].md +0 -0
- package/dist/logic/roles/ecologist/.briefs/product/user.journey.purpose.[article].i1.md +52 -0
- package/dist/logic/roles/ecologist/.briefs/product/user.journey.purpose.[article].md +52 -0
- package/dist/logic/roles/ecologist/.briefs/term.distillation.md +93 -0
- package/dist/logic/roles/mechanic/.briefs/architecture/bounded-contexts.md +61 -0
- package/dist/logic/roles/mechanic/.briefs/architecture/directional-dependencies.md +82 -0
- package/dist/logic/roles/mechanic/.briefs/architecture/domain-driven-design.md +61 -0
- package/dist/logic/roles/mechanic/.briefs/architecture/ubiqlang.md +37 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/_mech.compressed.md +57 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/_mech.compressed.prompt.md +5 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/flow.failfast.md +37 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/flow.idempotency.md +63 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/flow.immutability.md +48 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/flow.narratives.md +74 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/flow.single-responsibility.md +67 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/flow.transformers_over_conditionals.[lesson].md +97 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/mech.args.input-context.md +61 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/mech.args.input-inline.md +63 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/mech.arrowonly.md +47 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/mech.clear-contracts.md +53 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/mech.tests.given-when-then.md +62 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/mech.what-why.md +88 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/mech.what-why.v2.md +98 -0
- package/dist/logic/roles/mechanic/.briefs/codestyle/pit-of-success.via.minimize-surface-area.md +58 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/never.term.script.md +7 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/prefer.emojis.chill_nature.md +24 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/prefer.jq.over_alt.[demo].md +29 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/prefer.terraform.[criteria].md +4 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/prefer.terraform.[seed].md +17 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/require.dependency.pinned_versions.md +3 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/require.idempotency.md +33 -0
- package/dist/logic/roles/mechanic/.briefs/criteria.practices/require.knowledge.externalized.md +17 -0
- package/dist/logic/roles/mechanic/.briefs/engineer/dependency-injection.md +118 -0
- package/dist/logic/roles/mechanic/.briefs/engineer/dependency-injection.stub.md +11 -0
- package/dist/logic/roles/mechanic/.briefs/lessons/code.prod.typescript.types/bivariance_vs_contravariance.[lesson].md +95 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.contract.inputs.nameargs/bad-practice/forbid.positional-args.md +43 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.contract.inputs.nameargs/best-practice/require.namedargs.md +6 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.declarative/.readme.md +0 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.declarative/best-practice/declastruct.[demo].md +485 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/bad-practices/blocker.has.attributes.nullable.md +13 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/bad-practices/blocker.has.attributes.undefined.md +15 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/bad-practices/blocker.refs.immuatble.md +9 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.objects/best-practice/ref.package.domain-objects.[readme].md +585 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.domain.operations/best-practice/require.sync.names.md +14 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/bad-practices/forbid.failhide.md +19 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/bad-practices/forbid.hide_errors.md +13 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/best-practice/prefer.HelpfulError.wrap.md +54 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/best-practice/require.fail_fast.[demo].shell.md +17 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.errors.failfast/best-practice/require.fail_fast.md +28 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.narrative/bad-practices/forbid.else.md +54 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.narrative/best-practice/early-returns.named-checks.[demo].md +181 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.repo.structure/bad-practices/forbid.barrel.exports.ts.md +41 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.repo.structure/bad-practices/forbid.index.ts.md +3 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.repo.structure/best-practice/directional-dependencies.md +82 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.repo.structure/best-practice/dot-test-and-dot-temp.md +20 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.prod.typescript.utils/best-practice/ref.package.as-command.[tips].md +7 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.acceptance/best-practice/blackbox.md +5 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.diagnose.[lesson].md +14 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.run.[lesson].md +18 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.use.[lesson].md +20 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.[lesson].md +3 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.[lesson].on_scope.for_integ.md +8 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.[lesson].on_scope.for_units.md +9 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/howto.write.bdd.[lesson].md +280 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/prefer.datadriven.md +41 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/ref.test-fns.[readme].md +185 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/code.test.howto/best-practice/whento.snapshots.[lesson].md +23 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/.readme.md +1 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/bad-practices/forbid.term=existing.md +10 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/best-practice/require.order.noun_adj.md +39 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/domain=practices.terms=forbid_prefer_desire_require.md +13 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.terms/domain=software.terms=prodcode_vs_testcode.md +7 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.tones/.readme.md +3 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.tones/prefer.chill-nature.md +0 -0
- package/dist/logic/roles/mechanic/.briefs/patterns/lang.tones/prefer.lowercase.md +0 -0
- package/dist/logic/roles/mechanic/.briefs/style.compressed.md +29 -0
- package/dist/logic/roles/mechanic/.briefs/style.compressed.prompt.md +5 -0
- package/dist/logic/roles/mechanic/.briefs/style.names.treestruct.md +48 -0
- package/dist/logic/roles/mechanic/.briefs/style.names.ubiqlang.md +37 -0
- package/dist/logic/roles/mechanic/.briefs/style.words.lowercase.md +36 -0
- package/dist/logic/roles/mechanic/.briefs/terms/badpractice/script.md +9 -0
- package/dist/logic/roles/mechanic/.briefs/terms/plan.exec_vs_apply.md +45 -0
- package/dist/logic/roles/mechanic/.skills/claude.hooks/check.pretooluse.permissions.sh +346 -0
- package/dist/logic/roles/mechanic/.skills/claude.hooks/forbid.stderr.redirect.sh +57 -0
- package/dist/logic/roles/mechanic/.skills/claude.tools/mvsafe.sh +75 -0
- package/dist/logic/roles/mechanic/.skills/declapract.upgrade.sh +50 -0
- package/dist/logic/roles/mechanic/.skills/git.worktree.common.sh +58 -0
- package/dist/logic/roles/mechanic/.skills/git.worktree.del.sh +51 -0
- package/dist/logic/roles/mechanic/.skills/git.worktree.get.sh +51 -0
- package/dist/logic/roles/mechanic/.skills/git.worktree.set.sh +108 -0
- package/dist/logic/roles/mechanic/.skills/git.worktree.sh +46 -0
- package/dist/logic/roles/mechanic/.skills/init.bhuild.sh +260 -0
- package/dist/logic/roles/mechanic/.skills/init.claude.hooks.forbid.stderr.redirect.sh +116 -0
- package/dist/logic/roles/mechanic/.skills/init.claude.hooks.pretooluse.sh +118 -0
- package/dist/logic/roles/mechanic/.skills/init.claude.hooks.sessionstart.sh +113 -0
- package/dist/logic/roles/mechanic/.skills/init.claude.hooks.sh +25 -0
- package/dist/logic/roles/mechanic/.skills/init.claude.permissions.sh +159 -0
- package/dist/logic/roles/mechanic/.skills/init.claude.sh +47 -0
- package/dist/logic/roles/mechanic/.skills/link.claude.transcripts.sh +43 -0
- package/dist/logic/roles/mechanic/.skills/test.integration.sh +50 -0
- package/dist/logic/roles/mechanic/codediff/routeArtistCodeDiff.template.md +46 -0
- package/dist/logic/roles/mechanic/codediff/routeCriticCodeReviewArchitecture.template.md +78 -0
- package/dist/logic/roles/mechanic/codediff/routeCriticCodeReviewCodestyle.template.md +75 -0
- package/dist/logic/roles/mechanic/codediff/routeJudgeReleasable.template.md +67 -0
- package/dist/logic/roles/mechanic/study/routeStudyAsk.template.md +73 -0
- package/dist/logic/roles/mechanic/write/.test/prior.template.md +21 -0
- package/dist/logic/roles/mechanic/write/stepWrite.template.md +38 -0
- package/package.json +2 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.tactic = name:treestruct
|
|
2
|
+
|
|
3
|
+
.what = enforce `[verb][...noun]` for mechanisms and `[...noun][state]?` for resources
|
|
4
|
+
.where:
|
|
5
|
+
- `verb` = exactly one leading verb (e.g., `gen`, `set`, `get`, `map`)
|
|
6
|
+
- `...noun` = hierarchy of nouns reflecting the domain treestruct
|
|
7
|
+
- `state` = optional suffix representing state or outcome (e.g., `Updated`, `Found`, `After`, `Draft`)
|
|
8
|
+
- this tactic applies to all named functions, types, files, folders, and slugs
|
|
9
|
+
|
|
10
|
+
.why:
|
|
11
|
+
- maximizes autocomplete grouping by domain or action
|
|
12
|
+
- enables tree-sorted navigation in IDEs and file explorers
|
|
13
|
+
- avoids ambiguity and naming drift across boundaries (design, dev, product)
|
|
14
|
+
|
|
15
|
+
.how:
|
|
16
|
+
.rules:
|
|
17
|
+
- For **mechanisms** (functions, generators, procedures):
|
|
18
|
+
- use format: `[Verb][...NounHierarchy]`
|
|
19
|
+
- the verb must come **first**, and be **exactly one** action (e.g., `gen`, `set`, `get`, `map`, `submit`)
|
|
20
|
+
- e.g., `genStepImagineViaTemplate`, `setCustomerPhone`, `mapJobQuoteToEstimate`
|
|
21
|
+
- For **resources** (stateful data, outcomes, snapshots):
|
|
22
|
+
- use format: `[...NounHierarchy][State]?`
|
|
23
|
+
- the optional `State` suffix:
|
|
24
|
+
- is used when disambiguating multiple forms (e.g., `InvoiceDraft` vs `InvoiceFinal`)
|
|
25
|
+
- is typically a past participle or state label (e.g., `Found`, `After`, `Draft`)
|
|
26
|
+
- may be omitted if the base noun already implies a single clear meaning
|
|
27
|
+
- e.g., `contentFound`, `customer`, `invoiceDraft`
|
|
28
|
+
|
|
29
|
+
.examples:
|
|
30
|
+
.positive:
|
|
31
|
+
// mechanisms
|
|
32
|
+
- `genStepImagineViaTemplate` // generates a StitchStepImagine from a template
|
|
33
|
+
- `setCustomerPhone` // sets the customer's phone number
|
|
34
|
+
- `mapGitRepoToWorkspace` // maps a Git repo into a workspace domain
|
|
35
|
+
- `getInvoiceFinalizedState` // retrieves the final state of an invoice
|
|
36
|
+
|
|
37
|
+
// resources
|
|
38
|
+
- `contentFound` // content retrieved from a source
|
|
39
|
+
- `customer` // single canonical term for a user of services
|
|
40
|
+
- `invoiceDraft` // invoice in editable state
|
|
41
|
+
- `invoice` // base noun with implicit meaning
|
|
42
|
+
|
|
43
|
+
.negative:
|
|
44
|
+
- `stepImagineGenFromTemplate` // ⛔ wrong order — verb must come first
|
|
45
|
+
- `customerSet` // ⛔ vague mechanism — better as `setCustomer` or `setCustomerPhone`
|
|
46
|
+
- `FoundContent` // ⛔ reversed word order and PascalCase — should be `contentFound`
|
|
47
|
+
- `submitQuoteJob` // ⛔ noun hierarchy flipped — should be `submitJobQuote`
|
|
48
|
+
- `update()` // ⛔ unscoped verb — must include noun domain (e.g., `updateInvoice`)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.tactic = name:ubiqlang
|
|
2
|
+
|
|
3
|
+
.what = enforce a rigorous, domain-driven naming system rooted in ubiquitous language
|
|
4
|
+
.where:
|
|
5
|
+
- ubiquitous language = the shared, unambiguous vocabulary used by both domain experts and developers
|
|
6
|
+
- this tactic applies to all names: types, variables, functions, slugs, and folders
|
|
7
|
+
|
|
8
|
+
.why:
|
|
9
|
+
- eliminates ambiguity and cognitive friction
|
|
10
|
+
- ensures that everyone speaks the same language — in code, UI, tests, and docs
|
|
11
|
+
- prevents synonym drift (e.g., "client" vs "customer") and overload traps (e.g., "update" meaning 3 things)
|
|
12
|
+
|
|
13
|
+
.how:
|
|
14
|
+
- eliminate synonyms
|
|
15
|
+
- choose one canonical word per concept (e.g., always use `customer`, never `client`, `user`, or `account`)
|
|
16
|
+
- eliminate overloads
|
|
17
|
+
- each term must refer to one concept only (e.g., avoid using `update` for both "save data" and "fetch latest")
|
|
18
|
+
- use consistent term stacking across all code (e.g., `customerPhoneUpdate`, not `editPhoneNumber`)
|
|
19
|
+
- whenever a new term is introduced:
|
|
20
|
+
- define its interface, expected shape, and role
|
|
21
|
+
- document its meaning clearly and visibly (ideally in context or hover docs)
|
|
22
|
+
- ensure its usage is verified across type definitions, business rules, and communication flows
|
|
23
|
+
|
|
24
|
+
.examples:
|
|
25
|
+
.positive:
|
|
26
|
+
- `customer` instead of `client`, `user`, or `buyer`
|
|
27
|
+
- `jobQuote` as the single term for estimates/proposals
|
|
28
|
+
- `leadCapture` as the canonical action for inbound lead collection
|
|
29
|
+
- `customerPhoneUpdate` for updating a phone number
|
|
30
|
+
- `invoiceDraft` and `invoiceFinal` for two distinct invoice states
|
|
31
|
+
|
|
32
|
+
.negative:
|
|
33
|
+
- `client`, `user`, `account`, `buyer` all referring to the same actor
|
|
34
|
+
- `editCustomerPhone`, `changePhone`, `updateNumber` used interchangeably
|
|
35
|
+
- `job` used for both a requested service and a completed one
|
|
36
|
+
- `update()` overloaded to mean save, patch, sync, or refresh
|
|
37
|
+
- `quote`, `estimate`, `proposal`, and `bid` all floating without clear hierarchy
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.tactic = words:lowercase
|
|
2
|
+
|
|
3
|
+
.what = enforce lowercase for all words unless capitalization is required by code or naming convention
|
|
4
|
+
.where:
|
|
5
|
+
- applies to comments, docstrings, markdown, logs, and prompt copy
|
|
6
|
+
- only exceptions are code constructs (e.g., class names) and proper nouns (e.g., OpenAI)
|
|
7
|
+
|
|
8
|
+
.why:
|
|
9
|
+
- keeps language neutral, minimal, and machine-aligned
|
|
10
|
+
- prevents inconsistent or performative emphasis via caps
|
|
11
|
+
- improves scanability and reduces visual noise across surfaces
|
|
12
|
+
|
|
13
|
+
.how:
|
|
14
|
+
.rules:
|
|
15
|
+
- do not capitalize the first word of a sentence
|
|
16
|
+
- only use capitalization when:
|
|
17
|
+
- referencing a class, type, or constant (e.g., `StitchStepImagine`, `GitRepo`)
|
|
18
|
+
- writing a proper noun or brand (e.g., OpenAI, GitHub, AWS)
|
|
19
|
+
- never capitalize:
|
|
20
|
+
- generic nouns (`customer`, `invoice`, `step`)
|
|
21
|
+
- verbs (`set`, `get`, `submit`, `handle`)
|
|
22
|
+
- system comments or instructions, even at the beginning of a line
|
|
23
|
+
|
|
24
|
+
.examples:
|
|
25
|
+
.positive:
|
|
26
|
+
- `// returns a new invoice if customer exists`
|
|
27
|
+
- `// handled in gitrepo.init()`
|
|
28
|
+
- `// fallback if no customer was found`
|
|
29
|
+
- `// pass into StitchStepImagine to generate`
|
|
30
|
+
- `// openai prompt requires flattened string`
|
|
31
|
+
.negative:
|
|
32
|
+
- `// Returns a new invoice` // ⛔ capitalized sentence start
|
|
33
|
+
- `// This is handled in GitRepo` // ⛔ capitalized sentence + verb
|
|
34
|
+
- `// Submit the job for approval` // ⛔ capitalized imperative
|
|
35
|
+
- `// Customer must exist first` // ⛔ capitalized domain noun
|
|
36
|
+
- `// GitHub Repository` // ⛔ capitalized generic noun
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Execute vs Apply
|
|
2
|
+
|
|
3
|
+
## ⚙️ Execute
|
|
4
|
+
**Meaning:**
|
|
5
|
+
To **carry out** or **perform** something, especially a plan, command, or program.
|
|
6
|
+
|
|
7
|
+
**Connotation:**
|
|
8
|
+
Focuses on the **act of doing** — actually running the instructions.
|
|
9
|
+
|
|
10
|
+
**Examples:**
|
|
11
|
+
- The computer **executes** the program.
|
|
12
|
+
- She **executed** the plan perfectly.
|
|
13
|
+
- The database will **execute** this SQL query.
|
|
14
|
+
|
|
15
|
+
**Key idea:** "Do it."
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 🖐️ Apply
|
|
20
|
+
**Meaning:**
|
|
21
|
+
To **put something into use** or **bring it into effect** on a target or situation.
|
|
22
|
+
|
|
23
|
+
**Connotation:**
|
|
24
|
+
Focuses on **using something that already exists** (a tool, rule, concept, method, etc.) to affect something else.
|
|
25
|
+
|
|
26
|
+
**Examples:**
|
|
27
|
+
- Please **apply** the paint evenly.
|
|
28
|
+
- We can **apply** this algorithm to the data.
|
|
29
|
+
- He **applied** the brakes.
|
|
30
|
+
|
|
31
|
+
**Key idea:** "Use it (on something)."
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🧠 How They Differ
|
|
36
|
+
|
|
37
|
+
| | **Execute** | **Apply** |
|
|
38
|
+
|------------|------------------------------|----------------------------------|
|
|
39
|
+
| **Focus** | Performing an action or plan | Using something in a situation |
|
|
40
|
+
| **Implied object** | A plan, command, task | A method, tool, concept |
|
|
41
|
+
| **Example** | Execute a script | Apply a formula |
|
|
42
|
+
|
|
43
|
+
**Memory trick:**
|
|
44
|
+
- **Execute = do**
|
|
45
|
+
- **Apply = use**
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
######################################################################
|
|
3
|
+
# .what = PreToolUse hook to encourage reuse of existing permissions
|
|
4
|
+
#
|
|
5
|
+
# .why = when Claude attempts a command not covered by pre-approved
|
|
6
|
+
# permissions, this hook asks it to reconsider whether an
|
|
7
|
+
# existing permission could accomplish the same task.
|
|
8
|
+
#
|
|
9
|
+
# this reduces permission prompts and encourages consistent
|
|
10
|
+
# command patterns across the project.
|
|
11
|
+
#
|
|
12
|
+
# .how = reads JSON from stdin (per Claude Code docs), extracts
|
|
13
|
+
# tool_input.command, checks against allowed patterns.
|
|
14
|
+
# if no match, behavior depends on mode.
|
|
15
|
+
#
|
|
16
|
+
# usage:
|
|
17
|
+
# configure in .claude/settings.local.json under hooks.PreToolUse
|
|
18
|
+
#
|
|
19
|
+
# flags:
|
|
20
|
+
# --mode HARDNUDGE (default) blocks on first attempt, allows on retry
|
|
21
|
+
# tracks attempts in .claude/permissions.attempted.json
|
|
22
|
+
# forces Claude to consciously decide to request
|
|
23
|
+
# a new permission rather than doing so automatically
|
|
24
|
+
#
|
|
25
|
+
# --mode SOFTNUDGE outputs guidance but doesn't block (exit 0)
|
|
26
|
+
# Claude sees the message but can proceed immediately
|
|
27
|
+
#
|
|
28
|
+
# guarantee:
|
|
29
|
+
# ✔ HARDNUDGE (default): blocks first attempt, allows retry
|
|
30
|
+
# ✔ SOFTNUDGE: non-blocking, feedback only
|
|
31
|
+
# ✔ fast: simple pattern matching
|
|
32
|
+
# ✔ helpful: shows available alternatives
|
|
33
|
+
######################################################################
|
|
34
|
+
|
|
35
|
+
set -euo pipefail
|
|
36
|
+
|
|
37
|
+
# Parse flags
|
|
38
|
+
MODE="HARDNUDGE" # default
|
|
39
|
+
HARDNUDGE_WINDOW_SECONDS=60 # default: 60 seconds
|
|
40
|
+
while [[ $# -gt 0 ]]; do
|
|
41
|
+
case "$1" in
|
|
42
|
+
--mode)
|
|
43
|
+
MODE="${2:-HARDNUDGE}"
|
|
44
|
+
shift 2
|
|
45
|
+
;;
|
|
46
|
+
--window)
|
|
47
|
+
HARDNUDGE_WINDOW_SECONDS="${2:-60}"
|
|
48
|
+
shift 2
|
|
49
|
+
;;
|
|
50
|
+
*)
|
|
51
|
+
shift
|
|
52
|
+
;;
|
|
53
|
+
esac
|
|
54
|
+
done
|
|
55
|
+
|
|
56
|
+
# Read JSON from stdin (Claude Code passes input via stdin, not env var)
|
|
57
|
+
STDIN_INPUT=$(cat)
|
|
58
|
+
|
|
59
|
+
# failfast: if no input received, something is wrong
|
|
60
|
+
if [[ -z "$STDIN_INPUT" ]]; then
|
|
61
|
+
echo "ERROR: PreToolUse hook received no input via stdin" >&2
|
|
62
|
+
exit 2 # exit 2 = blocking error per Claude Code docs
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# Extract command from stdin JSON
|
|
66
|
+
# Claude passes: {"tool_name": "Bash", "tool_input": {"command": "..."}}
|
|
67
|
+
COMMAND=$(echo "$STDIN_INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null || echo "")
|
|
68
|
+
|
|
69
|
+
# Skip if not a Bash command or empty
|
|
70
|
+
if [[ -z "$COMMAND" ]]; then
|
|
71
|
+
exit 0
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# Find the .claude directory (search upward from current directory)
|
|
75
|
+
find_claude_dir() {
|
|
76
|
+
local dir="$PWD"
|
|
77
|
+
while [[ "$dir" != "/" ]]; do
|
|
78
|
+
if [[ -d "$dir/.claude" ]]; then
|
|
79
|
+
echo "$dir/.claude"
|
|
80
|
+
return 0
|
|
81
|
+
fi
|
|
82
|
+
dir="$(dirname "$dir")"
|
|
83
|
+
done
|
|
84
|
+
return 1
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# Find the settings file (search upward from current directory)
|
|
88
|
+
find_settings_file() {
|
|
89
|
+
local claude_dir
|
|
90
|
+
claude_dir=$(find_claude_dir) || return 1
|
|
91
|
+
local settings_file="$claude_dir/settings.local.json"
|
|
92
|
+
if [[ -f "$settings_file" ]]; then
|
|
93
|
+
echo "$settings_file"
|
|
94
|
+
return 0
|
|
95
|
+
fi
|
|
96
|
+
return 1
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
SETTINGS_FILE=$(find_settings_file) || {
|
|
100
|
+
# No settings file found, allow command to proceed
|
|
101
|
+
exit 0
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
# Extract Bash permissions from settings file
|
|
105
|
+
# Patterns look like: "Bash(npm run test:*)" -> extract "npm run test:*"
|
|
106
|
+
mapfile -t ALLOWED_PATTERNS < <(
|
|
107
|
+
jq -r '.permissions.allow // [] | .[] | select(startswith("Bash(")) | sub("^Bash\\("; "") | sub("\\)$"; "")' "$SETTINGS_FILE" 2>/dev/null
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
# Check if a single command matches any allowed pattern
|
|
111
|
+
match_pattern() {
|
|
112
|
+
local cmd="$1"
|
|
113
|
+
local pattern="$2"
|
|
114
|
+
|
|
115
|
+
# Handle Claude Code's :* suffix matcher
|
|
116
|
+
# :* means "match anything after" (any suffix, including spaces)
|
|
117
|
+
# e.g., "mkdir:*" matches "mkdir", "mkdir /path", "mkdir -p /foo/bar"
|
|
118
|
+
# e.g., "npm run test:*" matches "npm run test", "npm run test:unit"
|
|
119
|
+
|
|
120
|
+
# First, escape regex special chars except * and :
|
|
121
|
+
local escaped_pattern
|
|
122
|
+
escaped_pattern=$(printf '%s' "$pattern" | sed 's/[.^$+?{}()[\]|\\]/\\&/g')
|
|
123
|
+
|
|
124
|
+
# Convert :* to placeholder first (to avoid * -> .* conversion interfering)
|
|
125
|
+
escaped_pattern="${escaped_pattern//:\*/__ANY_SUFFIX_PLACEHOLDER__}"
|
|
126
|
+
|
|
127
|
+
# Convert remaining * to .* (glob-style wildcard)
|
|
128
|
+
escaped_pattern="${escaped_pattern//\*/.*}"
|
|
129
|
+
|
|
130
|
+
# Now replace placeholder with .* for "any suffix" matching
|
|
131
|
+
escaped_pattern="${escaped_pattern//__ANY_SUFFIX_PLACEHOLDER__/.*}"
|
|
132
|
+
|
|
133
|
+
# Build final regex
|
|
134
|
+
local regex="^${escaped_pattern}$"
|
|
135
|
+
|
|
136
|
+
if [[ "$cmd" =~ $regex ]]; then
|
|
137
|
+
return 0
|
|
138
|
+
fi
|
|
139
|
+
return 1
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
# Check if a single command matches ANY allowed pattern
|
|
143
|
+
command_is_allowed() {
|
|
144
|
+
local cmd="$1"
|
|
145
|
+
# Trim leading/trailing whitespace
|
|
146
|
+
cmd=$(echo "$cmd" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
147
|
+
|
|
148
|
+
# Empty commands are allowed (e.g., trailing &&)
|
|
149
|
+
if [[ -z "$cmd" ]]; then
|
|
150
|
+
return 0
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
for pattern in "${ALLOWED_PATTERNS[@]}"; do
|
|
154
|
+
if match_pattern "$cmd" "$pattern"; then
|
|
155
|
+
return 0
|
|
156
|
+
fi
|
|
157
|
+
done
|
|
158
|
+
return 1
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
# Split compound command on &&, ||, ; (respecting quotes)
|
|
162
|
+
# Returns newline-separated list of commands
|
|
163
|
+
split_compound_command() {
|
|
164
|
+
local input="$1"
|
|
165
|
+
local result=""
|
|
166
|
+
local current=""
|
|
167
|
+
local in_single_quote=false
|
|
168
|
+
local in_double_quote=false
|
|
169
|
+
local i=0
|
|
170
|
+
local len=${#input}
|
|
171
|
+
|
|
172
|
+
while [[ $i -lt $len ]]; do
|
|
173
|
+
local char="${input:$i:1}"
|
|
174
|
+
local next_char="${input:$((i+1)):1}"
|
|
175
|
+
|
|
176
|
+
# Handle quotes
|
|
177
|
+
if [[ "$char" == "'" && "$in_double_quote" == false ]]; then
|
|
178
|
+
in_single_quote=$([[ "$in_single_quote" == true ]] && echo false || echo true)
|
|
179
|
+
current+="$char"
|
|
180
|
+
((i++))
|
|
181
|
+
continue
|
|
182
|
+
fi
|
|
183
|
+
|
|
184
|
+
if [[ "$char" == '"' && "$in_single_quote" == false ]]; then
|
|
185
|
+
in_double_quote=$([[ "$in_double_quote" == true ]] && echo false || echo true)
|
|
186
|
+
current+="$char"
|
|
187
|
+
((i++))
|
|
188
|
+
continue
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
# Only split if not inside quotes
|
|
192
|
+
if [[ "$in_single_quote" == false && "$in_double_quote" == false ]]; then
|
|
193
|
+
# Check for && or ||
|
|
194
|
+
if [[ "$char" == "&" && "$next_char" == "&" ]] || [[ "$char" == "|" && "$next_char" == "|" ]]; then
|
|
195
|
+
if [[ -n "$result" ]]; then
|
|
196
|
+
result+=$'\n'
|
|
197
|
+
fi
|
|
198
|
+
result+="$current"
|
|
199
|
+
current=""
|
|
200
|
+
((i+=2))
|
|
201
|
+
continue
|
|
202
|
+
fi
|
|
203
|
+
|
|
204
|
+
# Check for ;
|
|
205
|
+
if [[ "$char" == ";" ]]; then
|
|
206
|
+
if [[ -n "$result" ]]; then
|
|
207
|
+
result+=$'\n'
|
|
208
|
+
fi
|
|
209
|
+
result+="$current"
|
|
210
|
+
current=""
|
|
211
|
+
((i++))
|
|
212
|
+
continue
|
|
213
|
+
fi
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
current+="$char"
|
|
217
|
+
((i++))
|
|
218
|
+
done
|
|
219
|
+
|
|
220
|
+
# Add final command
|
|
221
|
+
if [[ -n "$result" ]]; then
|
|
222
|
+
result+=$'\n'
|
|
223
|
+
fi
|
|
224
|
+
result+="$current"
|
|
225
|
+
|
|
226
|
+
echo "$result"
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
# Check if ALL parts of a compound command are allowed
|
|
230
|
+
all_parts_allowed() {
|
|
231
|
+
local cmd="$1"
|
|
232
|
+
local parts
|
|
233
|
+
local failed_part=""
|
|
234
|
+
|
|
235
|
+
# Split command into parts
|
|
236
|
+
parts=$(split_compound_command "$cmd")
|
|
237
|
+
|
|
238
|
+
# Check each part
|
|
239
|
+
while IFS= read -r part; do
|
|
240
|
+
# Trim whitespace
|
|
241
|
+
part=$(echo "$part" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
242
|
+
|
|
243
|
+
# Skip empty parts
|
|
244
|
+
[[ -z "$part" ]] && continue
|
|
245
|
+
|
|
246
|
+
if ! command_is_allowed "$part"; then
|
|
247
|
+
# Store the failed part for error reporting
|
|
248
|
+
echo "$part"
|
|
249
|
+
return 1
|
|
250
|
+
fi
|
|
251
|
+
done <<< "$parts"
|
|
252
|
+
|
|
253
|
+
return 0
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
# Transform raw permission pattern to compact bracket notation for display
|
|
257
|
+
format_pattern() {
|
|
258
|
+
local pattern="$1"
|
|
259
|
+
|
|
260
|
+
# Check if pattern ends with :*
|
|
261
|
+
if [[ "$pattern" == *":*" ]]; then
|
|
262
|
+
# Remove :* suffix and format with [p]: label (prefix match)
|
|
263
|
+
local prefix="${pattern%:*}"
|
|
264
|
+
echo "[p]: $prefix"
|
|
265
|
+
else
|
|
266
|
+
# Exact match - format with [e]: label
|
|
267
|
+
echo "[e]: $pattern"
|
|
268
|
+
fi
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
# Check if all parts of the command (including compound commands) are allowed
|
|
272
|
+
FAILED_PART=$(all_parts_allowed "$COMMAND") && exit 0
|
|
273
|
+
|
|
274
|
+
# Command not matched - handle based on mode
|
|
275
|
+
# FAILED_PART contains the first disallowed part of the command
|
|
276
|
+
|
|
277
|
+
# SOFTNUDGE mode: provide guidance but don't block (early return)
|
|
278
|
+
# Output plain text - no hookSpecificOutput so normal permission flow continues
|
|
279
|
+
if [[ "$MODE" == "SOFTNUDGE" ]]; then
|
|
280
|
+
echo ""
|
|
281
|
+
echo "⚠️ This command is not covered by existing pre-approved permissions."
|
|
282
|
+
echo ""
|
|
283
|
+
echo "Before requesting user approval, check if you can accomplish this task using one of these pre-approved patterns:"
|
|
284
|
+
echo ""
|
|
285
|
+
echo "([e] = exact match, [p] = prefix match)"
|
|
286
|
+
echo ""
|
|
287
|
+
for pattern in "${ALLOWED_PATTERNS[@]}"; do
|
|
288
|
+
echo " • $(format_pattern "$pattern")"
|
|
289
|
+
done
|
|
290
|
+
echo ""
|
|
291
|
+
echo "([e] = exact match, [p] = prefix match)"
|
|
292
|
+
echo ""
|
|
293
|
+
echo "If an existing permission pattern can solve your task, use that instead."
|
|
294
|
+
echo "If not, proceed with requesting approval."
|
|
295
|
+
echo ""
|
|
296
|
+
exit 0
|
|
297
|
+
fi
|
|
298
|
+
|
|
299
|
+
# HARDNUDGE mode (default): block on first attempt, allow on retry
|
|
300
|
+
CLAUDE_DIR=$(find_claude_dir) || {
|
|
301
|
+
echo "ERROR: No .claude directory found. This hook requires a .claude directory." >&2
|
|
302
|
+
exit 1
|
|
303
|
+
}
|
|
304
|
+
ATTEMPTED_FILE="$CLAUDE_DIR/permission.nudges.local.json"
|
|
305
|
+
|
|
306
|
+
# Ensure the file exists with valid JSON
|
|
307
|
+
if [[ ! -f "$ATTEMPTED_FILE" ]]; then
|
|
308
|
+
echo '{}' > "$ATTEMPTED_FILE"
|
|
309
|
+
fi
|
|
310
|
+
|
|
311
|
+
# Check if this command was recently attempted
|
|
312
|
+
now=$(date +%s)
|
|
313
|
+
last_attempt=$(jq -r --arg cmd "$COMMAND" '.[$cmd] // 0' "$ATTEMPTED_FILE" 2>/dev/null || echo "0")
|
|
314
|
+
elapsed=$((now - last_attempt))
|
|
315
|
+
|
|
316
|
+
if [[ $elapsed -lt $HARDNUDGE_WINDOW_SECONDS ]]; then
|
|
317
|
+
# Claude already tried within the window - they've thought twice
|
|
318
|
+
# Exit silently with 0 so normal permission flow continues (user gets prompted)
|
|
319
|
+
exit 0
|
|
320
|
+
fi
|
|
321
|
+
|
|
322
|
+
# First attempt - record timestamp and block
|
|
323
|
+
# Use a temp file for atomic update
|
|
324
|
+
tmp_file=$(mktemp)
|
|
325
|
+
jq --arg cmd "$COMMAND" --argjson ts "$now" '. + {($cmd): $ts}' "$ATTEMPTED_FILE" > "$tmp_file" 2>/dev/null && mv "$tmp_file" "$ATTEMPTED_FILE"
|
|
326
|
+
|
|
327
|
+
# Output block message to stderr and exit 2 to deny
|
|
328
|
+
{
|
|
329
|
+
echo ""
|
|
330
|
+
echo "🛑 BLOCKED: This command is not covered by existing pre-approved permissions."
|
|
331
|
+
echo ""
|
|
332
|
+
echo "Before requesting user approval, check if you can accomplish this task using one of these pre-approved patterns:"
|
|
333
|
+
echo ""
|
|
334
|
+
echo "([e] = exact match, [p] = prefix match)"
|
|
335
|
+
echo ""
|
|
336
|
+
for pattern in "${ALLOWED_PATTERNS[@]}"; do
|
|
337
|
+
echo " • $(format_pattern "$pattern")"
|
|
338
|
+
done
|
|
339
|
+
echo ""
|
|
340
|
+
echo "([e] = exact match, [p] = prefix match)"
|
|
341
|
+
echo ""
|
|
342
|
+
echo "If an existing permission pattern can solve your task, use that instead."
|
|
343
|
+
echo "If you've considered the alternatives and still need this specific command, retry it."
|
|
344
|
+
echo ""
|
|
345
|
+
} >&2
|
|
346
|
+
exit 2 # Exit 2 = block with error message
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
######################################################################
|
|
3
|
+
# .what = PreToolUse hook to forbid 2>&1 (stderr redirection)
|
|
4
|
+
#
|
|
5
|
+
# .why = redirecting stderr to stdout (2>&1) hides error messages
|
|
6
|
+
# and makes debugging harder. Claude should see stderr
|
|
7
|
+
# separately to understand when commands fail.
|
|
8
|
+
#
|
|
9
|
+
# .how = reads JSON from stdin, extracts tool_input.command,
|
|
10
|
+
# checks if it contains 2>&1 and blocks if found.
|
|
11
|
+
#
|
|
12
|
+
# usage:
|
|
13
|
+
# configure in .claude/settings.local.json under hooks.PreToolUse
|
|
14
|
+
#
|
|
15
|
+
# guarantee:
|
|
16
|
+
# ✔ blocks commands containing 2>&1
|
|
17
|
+
# ✔ fast: simple string matching
|
|
18
|
+
# ✔ helpful: explains why it's blocked
|
|
19
|
+
######################################################################
|
|
20
|
+
|
|
21
|
+
set -euo pipefail
|
|
22
|
+
|
|
23
|
+
# Read JSON from stdin (Claude Code passes input via stdin)
|
|
24
|
+
STDIN_INPUT=$(cat)
|
|
25
|
+
|
|
26
|
+
# failfast: if no input received, something is wrong
|
|
27
|
+
if [[ -z "$STDIN_INPUT" ]]; then
|
|
28
|
+
echo "ERROR: PreToolUse hook received no input via stdin" >&2
|
|
29
|
+
exit 2
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Extract command from stdin JSON
|
|
33
|
+
# Claude passes: {"tool_name": "Bash", "tool_input": {"command": "..."}}
|
|
34
|
+
COMMAND=$(echo "$STDIN_INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null || echo "")
|
|
35
|
+
|
|
36
|
+
# Skip if not a Bash command or empty
|
|
37
|
+
if [[ -z "$COMMAND" ]]; then
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Check if command contains 2>&1
|
|
42
|
+
if [[ "$COMMAND" == *"2>&1"* ]]; then
|
|
43
|
+
{
|
|
44
|
+
echo ""
|
|
45
|
+
echo "🛑 BLOCKED: Command contains '2>&1' (stderr redirect to stdout)."
|
|
46
|
+
echo ""
|
|
47
|
+
echo "Redirecting stderr to stdout hides error messages and makes debugging harder."
|
|
48
|
+
echo "Claude should see stderr separately to understand when commands fail."
|
|
49
|
+
echo ""
|
|
50
|
+
echo "Please remove '2>&1' from your command and try again."
|
|
51
|
+
echo ""
|
|
52
|
+
} >&2
|
|
53
|
+
exit 2
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
# Command is allowed
|
|
57
|
+
exit 0
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
######################################################################
|
|
3
|
+
# .what = safe mv wrapper that constrains moves to within the repo
|
|
4
|
+
#
|
|
5
|
+
# .why = mv can move/overwrite files anywhere on the filesystem.
|
|
6
|
+
# this wrapper ensures both source and destination resolve
|
|
7
|
+
# to paths within the current working directory (repo root).
|
|
8
|
+
#
|
|
9
|
+
# .how = uses realpath to resolve absolute paths, then validates
|
|
10
|
+
# both are prefixed by $PWD before executing mv.
|
|
11
|
+
#
|
|
12
|
+
# usage:
|
|
13
|
+
# bash mvsafe.sh <source> <destination>
|
|
14
|
+
#
|
|
15
|
+
# guarantee:
|
|
16
|
+
# ✔ fails if source is outside repo
|
|
17
|
+
# ✔ fails if destination is outside repo
|
|
18
|
+
# ✔ fails if source doesn't exist
|
|
19
|
+
# ✔ passes all arguments to mv if validation passes
|
|
20
|
+
######################################################################
|
|
21
|
+
|
|
22
|
+
set -euo pipefail
|
|
23
|
+
|
|
24
|
+
if [[ $# -lt 2 ]]; then
|
|
25
|
+
echo "error: mvsafe requires at least 2 arguments" >&2
|
|
26
|
+
echo "usage: mvsafe.sh <source> <destination>" >&2
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
REPO_ROOT="$PWD"
|
|
31
|
+
|
|
32
|
+
# get the last argument (destination)
|
|
33
|
+
DEST="${*: -1}"
|
|
34
|
+
|
|
35
|
+
# get all arguments except the last (sources, could be multiple)
|
|
36
|
+
SOURCES=("${@:1:$#-1}")
|
|
37
|
+
|
|
38
|
+
# resolve destination path
|
|
39
|
+
# if dest doesn't exist yet, resolve its parent directory
|
|
40
|
+
if [[ -e "$DEST" ]]; then
|
|
41
|
+
DEST_RESOLVED="$(realpath "$DEST")"
|
|
42
|
+
else
|
|
43
|
+
DEST_PARENT="$(dirname "$DEST")"
|
|
44
|
+
if [[ ! -d "$DEST_PARENT" ]]; then
|
|
45
|
+
echo "error: destination parent directory does not exist: $DEST_PARENT" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
DEST_RESOLVED="$(realpath "$DEST_PARENT")/$(basename "$DEST")"
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# validate destination is within repo
|
|
52
|
+
if [[ "$DEST_RESOLVED" != "$REPO_ROOT"* ]]; then
|
|
53
|
+
echo "error: destination is outside repo: $DEST_RESOLVED" >&2
|
|
54
|
+
echo " repo root: $REPO_ROOT" >&2
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# validate each source is within repo
|
|
59
|
+
for SRC in "${SOURCES[@]}"; do
|
|
60
|
+
if [[ ! -e "$SRC" ]]; then
|
|
61
|
+
echo "error: source does not exist: $SRC" >&2
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
SRC_RESOLVED="$(realpath "$SRC")"
|
|
66
|
+
|
|
67
|
+
if [[ "$SRC_RESOLVED" != "$REPO_ROOT"* ]]; then
|
|
68
|
+
echo "error: source is outside repo: $SRC_RESOLVED" >&2
|
|
69
|
+
echo " repo root: $REPO_ROOT" >&2
|
|
70
|
+
exit 1
|
|
71
|
+
fi
|
|
72
|
+
done
|
|
73
|
+
|
|
74
|
+
# all validations passed, execute mv
|
|
75
|
+
exec mv "$@"
|