bossbuild 0.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/PRINCIPLES.md +70 -0
- package/README.md +213 -0
- package/VERSION +1 -0
- package/bin/boss +3 -0
- package/library/README.md +19 -0
- package/library/agents/.gitkeep +0 -0
- package/library/agents/mentor-venture.md +57 -0
- package/library/hooks/.gitkeep +0 -0
- package/library/hooks/auto-log.js +133 -0
- package/library/hooks/memory-cue.js +82 -0
- package/library/hooks/secrets-guard.js +87 -0
- package/library/memory-seed/README.md +29 -0
- package/library/memory-seed/durable-facts-example.md +16 -0
- package/library/practices/.gitkeep +0 -0
- package/library/practices/agent-security.md +111 -0
- package/library/practices/ai-adoption-culture.md +104 -0
- package/library/practices/ai-ux-patterns.md +246 -0
- package/library/practices/celebration-of-done.md +100 -0
- package/library/practices/conscience-voicing.md +121 -0
- package/library/practices/context-discipline.md +116 -0
- package/library/practices/design-system.md +152 -0
- package/library/practices/git-workflow.md +119 -0
- package/library/practices/harm-taxonomy.md +45 -0
- package/library/practices/quality-ratchet.md +48 -0
- package/library/practices/revalidation.md +57 -0
- package/library/practices/scalable-architecture.md +111 -0
- package/library/practices/ship-it-live.md +149 -0
- package/library/practices/skill-authoring.md +70 -0
- package/library/skills/.gitkeep +0 -0
- package/library/skills/boss-learn/SKILL.md +63 -0
- package/library/skills/boss-sync/SKILL.md +48 -0
- package/package.json +49 -0
- package/registry/CHANGELOG.md +2737 -0
- package/src/board.js +655 -0
- package/src/brain.js +288 -0
- package/src/cli.js +542 -0
- package/src/conscience.js +426 -0
- package/src/insights.js +147 -0
- package/src/learn.js +92 -0
- package/src/map.js +103 -0
- package/src/modes.js +82 -0
- package/src/paths.js +36 -0
- package/src/registry.js +34 -0
- package/src/scaffold.js +138 -0
- package/src/sync.js +292 -0
- package/src/team.js +103 -0
- package/stages/L0-quickstart/manifest.json +12 -0
- package/stages/L0-quickstart/template/.claude/agents/coder-generalist.md +31 -0
- package/stages/L0-quickstart/template/.claude/agents/mentor-venture.md +57 -0
- package/stages/L0-quickstart/template/.claude/agents/pm.md +28 -0
- package/stages/L0-quickstart/template/.claude/hooks/conscience.js +89 -0
- package/stages/L0-quickstart/template/.claude/hooks/lib/loop-runtime.js +507 -0
- package/stages/L0-quickstart/template/.claude/hooks/lib/yaml.js +163 -0
- package/stages/L0-quickstart/template/.claude/hooks/memory-cue.js +82 -0
- package/stages/L0-quickstart/template/.claude/hooks/secrets-guard.js +87 -0
- package/stages/L0-quickstart/template/.claude/rules/your-app-code.md +17 -0
- package/stages/L0-quickstart/template/.claude/settings.json +36 -0
- package/stages/L0-quickstart/template/.claude/skills/boss/SKILL.md +161 -0
- package/stages/L0-quickstart/template/.claude/skills/boss-learn/SKILL.md +63 -0
- package/stages/L0-quickstart/template/.claude/skills/boss-sync/SKILL.md +55 -0
- package/stages/L0-quickstart/template/.claude/skills/canvas/SKILL.md +112 -0
- package/stages/L0-quickstart/template/.claude/skills/comprehend/SKILL.md +72 -0
- package/stages/L0-quickstart/template/.claude/skills/decide/SKILL.md +122 -0
- package/stages/L0-quickstart/template/.claude/skills/feedback/SKILL.md +68 -0
- package/stages/L0-quickstart/template/.claude/skills/import/SKILL.md +73 -0
- package/stages/L0-quickstart/template/.claude/skills/persona/SKILL.md +92 -0
- package/stages/L0-quickstart/template/.claude/skills/prototype/SKILL.md +114 -0
- package/stages/L0-quickstart/template/.claude/skills/triage/SKILL.md +104 -0
- package/stages/L0-quickstart/template/.claude/skills/welcome/SKILL.md +262 -0
- package/stages/L0-quickstart/template/AGENTS.md +31 -0
- package/stages/L0-quickstart/template/CLAUDE.md +57 -0
- package/stages/L0-quickstart/template/docs/IDS.md +42 -0
- package/stages/L0-quickstart/template/docs/ideas/INDEX.md +24 -0
- package/stages/L0-quickstart/template/docs/loops/canvas-loop.md +90 -0
- package/stages/L0-quickstart/template/docs/loops/capture-loop.md +64 -0
- package/stages/L1-mvp/manifest.json +12 -0
- package/stages/L1-mvp/template/.claude/agents/mentor-architect.md +124 -0
- package/stages/L1-mvp/template/.claude/agents/mentor-cofounder.md +85 -0
- package/stages/L1-mvp/template/.claude/agents/mentor-gtm.md +49 -0
- package/stages/L1-mvp/template/.claude/agents/program-manager.md +46 -0
- package/stages/L1-mvp/template/.claude/agents/tester.md +42 -0
- package/stages/L1-mvp/template/.claude/hooks/auto-log.js +133 -0
- package/stages/L1-mvp/template/.claude/rules/feature-context.md +18 -0
- package/stages/L1-mvp/template/.claude/skills/ai-cost/SKILL.md +249 -0
- package/stages/L1-mvp/template/.claude/skills/ai-failure-states/SKILL.md +226 -0
- package/stages/L1-mvp/template/.claude/skills/ai-first-init/SKILL.md +227 -0
- package/stages/L1-mvp/template/.claude/skills/close/SKILL.md +170 -0
- package/stages/L1-mvp/template/.claude/skills/consult/SKILL.md +72 -0
- package/stages/L1-mvp/template/.claude/skills/cost-review/SKILL.md +204 -0
- package/stages/L1-mvp/template/.claude/skills/design-tokens-init/SKILL.md +192 -0
- package/stages/L1-mvp/template/.claude/skills/drift-deep/SKILL.md +170 -0
- package/stages/L1-mvp/template/.claude/skills/evals/SKILL.md +154 -0
- package/stages/L1-mvp/template/.claude/skills/extract/SKILL.md +209 -0
- package/stages/L1-mvp/template/.claude/skills/judge-traces/SKILL.md +68 -0
- package/stages/L1-mvp/template/.claude/skills/log/SKILL.md +64 -0
- package/stages/L1-mvp/template/.claude/skills/practice/SKILL.md +92 -0
- package/stages/L1-mvp/template/.claude/skills/pretotype/SKILL.md +95 -0
- package/stages/L1-mvp/template/.claude/skills/red-team/SKILL.md +137 -0
- package/stages/L1-mvp/template/.claude/skills/revalidate/SKILL.md +51 -0
- package/stages/L1-mvp/template/.claude/skills/ship/SKILL.md +105 -0
- package/stages/L1-mvp/template/.claude/skills/smoke/SKILL.md +43 -0
- package/stages/L1-mvp/template/.claude/skills/spec/SKILL.md +145 -0
- package/stages/L1-mvp/template/claude-append.md +122 -0
- package/stages/L1-mvp/template/docs/loops/ai-failure-state-loop.md +107 -0
- package/stages/L1-mvp/template/docs/loops/coordination-loop.md +116 -0
- package/stages/L1-mvp/template/docs/loops/cost-budget-loop.md +117 -0
- package/stages/L1-mvp/template/docs/loops/cost-review-loop.md +113 -0
- package/stages/L1-mvp/template/docs/loops/design-tokens-loop.md +98 -0
- package/stages/L1-mvp/template/docs/loops/drift-loop.md +149 -0
- package/stages/L1-mvp/template/docs/loops/extraction-loop.md +128 -0
- package/stages/L1-mvp/template/docs/loops/focus-loop.md +106 -0
- package/stages/L1-mvp/template/docs/loops/pretotype-loop.md +88 -0
- package/stages/L1-mvp/template/docs/loops/spec-loop.md +83 -0
- package/stages/L2-v1/manifest.json +12 -0
- package/stages/L2-v1/template/.claude/agents/db-architect.md +91 -0
- package/stages/L2-v1/template/.claude/agents/mentor-business.md +124 -0
- package/stages/L2-v1/template/.claude/agents/mentor-fundraising.md +72 -0
- package/stages/L2-v1/template/.claude/agents/mentor-pitch.md +84 -0
- package/stages/L2-v1/template/.claude/agents/mentor-talent.md +84 -0
- package/stages/L2-v1/template/.claude/agents/ui-designer.md +81 -0
- package/stages/L2-v1/template/.claude/agents/ux-designer.md +87 -0
- package/stages/L2-v1/template/.claude/skills/board/SKILL.md +98 -0
- package/stages/L2-v1/template/.claude/skills/design-review/SKILL.md +77 -0
- package/stages/L2-v1/template/.claude/skills/ux-check/SKILL.md +93 -0
- package/stages/L2-v1/template/claude-append.md +59 -0
- package/stages/L2-v1/template/docs/loops/design-drift-loop.md +108 -0
- package/stages/L3-scale/README.md +13 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ajesh Shah
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PRINCIPLES.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# BOSS — Operating Principles
|
|
2
|
+
|
|
3
|
+
## The why (the problem BOSS exists for)
|
|
4
|
+
|
|
5
|
+
Founders can now build faster than they can validate. AI makes a polished prototype cheap — which
|
|
6
|
+
creates a new trap: confusing a **pseudo app** (an impressive demo with no proven pain, workflow fit,
|
|
7
|
+
willingness to pay, distribution, or reliability) with a **real business value app** (solves a painful
|
|
8
|
+
problem for a specific customer, fits a real workflow, creates measurable value, has a path to
|
|
9
|
+
distribution). BOSS is the guidance layer between those two states.
|
|
10
|
+
|
|
11
|
+
> **BOSS helps founders build faster without fooling themselves** — compressing the loop from idea to
|
|
12
|
+
> evidence while continuously checking the work against real pain, real workflows, real buyers, real
|
|
13
|
+
> economics, and real distribution. The goal is not more pseudo apps; it's real business value apps.
|
|
14
|
+
|
|
15
|
+
What that buys is narrower — and stronger — than "discipline wins." Disciplined validation doesn't
|
|
16
|
+
guarantee a win; it makes you **decide faster, including quitting faster** (Camuffo et al., 759-firm
|
|
17
|
+
RCT [EVIDENCE]). Cheap AI lowers the cost of *building*, not the cost of *being wrong* — so the cheaper
|
|
18
|
+
building gets, the more the loop matters, not less. BOSS's conscience exists to stop self-fooling, and
|
|
19
|
+
that has to include BOSS not overclaiming its own promise.
|
|
20
|
+
|
|
21
|
+
The six rules below are how that promise is kept.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
The few rules that define what BOSS *is*. Everything else (modes, skills, the CLI) is in service of these.
|
|
26
|
+
|
|
27
|
+
## 1. Always scaffolding — pause to extract patterns
|
|
28
|
+
|
|
29
|
+
BOSS is always scaffolding, but scaffolding is the *motion*, not the goal. At every natural
|
|
30
|
+
breakpoint — a mode transition, a shipped feature, the third time the same work repeats — **pause
|
|
31
|
+
and sort the pattern two ways:**
|
|
32
|
+
|
|
33
|
+
- **UP** → into BOSS as a reusable **superset practice**. Every future project inherits it.
|
|
34
|
+
- **DOWN** → into the app as **core functionality**. It's product, not scaffold.
|
|
35
|
+
|
|
36
|
+
This bidirectional extraction is what makes the system compound: every project makes BOSS smarter,
|
|
37
|
+
and every app's core stays clean. `/boss-learn` is therefore a **two-destination router**, not a
|
|
38
|
+
one-way "promote to BOSS."
|
|
39
|
+
|
|
40
|
+
## 2. Just-in-time support, never premature ceremony
|
|
41
|
+
|
|
42
|
+
BOSS is a startup incubator: the right level of support shows up exactly when a project earns it,
|
|
43
|
+
and not before. A throwaway Quickstart idea should not carry a PM org; a Scale-mode product should
|
|
44
|
+
not be missing one. Modes (Quickstart → MVP → V1 → Scale) exist to make this graduated. Rules turn
|
|
45
|
+
on **at the right time**, per mode.
|
|
46
|
+
|
|
47
|
+
## 3. Nothing valuable gets locked into code
|
|
48
|
+
|
|
49
|
+
Anything reusable — design tokens, prompts, workflows, conventions — should live as **decoupled,
|
|
50
|
+
nameable structure**, not buried in implementation. Style is the canonical case: extract it into
|
|
51
|
+
tokens + a style guide the moment there's UI, so it stays evolvable and **prototypes consume the
|
|
52
|
+
same system the app does**. Enforced JIT (strict at V1; seeded as soon as UI appears). The test:
|
|
53
|
+
*could a prototype or a sibling project reuse this without copy-pasting code?* If not, it's locked.
|
|
54
|
+
|
|
55
|
+
## 4. Stack-neutral; stacks are learned, not assumed
|
|
56
|
+
|
|
57
|
+
BOSS assumes no tech stack. The first build decision picks one. Proven stack tooling is captured
|
|
58
|
+
via Principle 1 (UP) so the next project of that kind starts from it — stack profiles are an
|
|
59
|
+
*output* of the learning loop, not a pre-baked input.
|
|
60
|
+
|
|
61
|
+
## 5. Optionality by default
|
|
62
|
+
|
|
63
|
+
Defaults preserve future choices rather than foreclosing them: private repos, proprietary license
|
|
64
|
+
(relicense to OSS later — not the reverse), snapshot-not-blueprint canvases. Decide late, on evidence.
|
|
65
|
+
|
|
66
|
+
## 6. Humane before viable
|
|
67
|
+
|
|
68
|
+
The Humane Product Canvas is the spine of how BOSS pressure-tests an idea — who's served, what
|
|
69
|
+
tension, what promise, who could be harmed — *then* commercial rigor (riskiest assumption, weekly
|
|
70
|
+
experiment, willingness to pay) folds in. Viability never overrides the humane lens.
|
package/README.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# BOSS
|
|
2
|
+
|
|
3
|
+
### Make it real.
|
|
4
|
+
|
|
5
|
+
*B.O.S.S. — Build Out Solid Stuff.*
|
|
6
|
+
|
|
7
|
+
> **Everyone can build now. Almost no one can tell a real business from a convincing demo.**
|
|
8
|
+
> **BOSS is the conscience that keeps you honest while you move fast** — the thinking layer that
|
|
9
|
+
> nudges when you're drifting and pauses on command. No growth-hacking pressure. Override-friendly.
|
|
10
|
+
>
|
|
11
|
+
> *(Vibe coding gets you a demo; the discipline on top gets you a business. BOSS is that discipline,
|
|
12
|
+
> just-in-time. Pause it any time.)*
|
|
13
|
+
>
|
|
14
|
+
> Cursor and Lovable generate the code. BOSS scaffolds the *thinking about what to build, when
|
|
15
|
+
> to ship, and when the discipline should get out of your way.* Brings a mentor board for the
|
|
16
|
+
> parts code can't teach, a conscience that catches drift early, modes that scale ceremony to
|
|
17
|
+
> evidence. Calm-company by default. Open. Inspectable. Local-only state.
|
|
18
|
+
|
|
19
|
+
## If this is you
|
|
20
|
+
|
|
21
|
+
You've been using Claude Code for a few months. You've shipped one project this
|
|
22
|
+
year. There are two more in `~/projects/` you didn't finish, and a folder of ideas you didn't
|
|
23
|
+
start. Each new project, you re-invent the same scaffolding — and somewhere around screen 3
|
|
24
|
+
the design starts drifting (47 different blues, every component a snowflake), or you realize
|
|
25
|
+
you never actually pressure-tested whether the bet was real.
|
|
26
|
+
|
|
27
|
+
The honest question AI raised: *if I can build anything, what should I build, and how do I
|
|
28
|
+
know if it's worth finishing?*
|
|
29
|
+
|
|
30
|
+
BOSS is one answer.
|
|
31
|
+
|
|
32
|
+
## What BOSS is, plainly
|
|
33
|
+
|
|
34
|
+
A CLI plus a set of skills, agents, and loops that run inside Claude Code:
|
|
35
|
+
|
|
36
|
+
- **`boss new my-app`** — scaffolds a project at the lightest level (Quickstart) in five seconds.
|
|
37
|
+
Then `/boss <your idea>` to spin up — point it at a sentence, a doc, a Google Doc, an Obsidian
|
|
38
|
+
note, a PDF, or a URL, and BOSS pulls the material in and shapes it. Optional private GitHub repo;
|
|
39
|
+
a `CLAUDE.md` that fits on a screen.
|
|
40
|
+
- **`boss unlock mvp`** — adds the spec discipline (`/spec` with validated-learning + evals
|
|
41
|
+
fields), the smoke gate, the demand-test step (`/pretotype` — Savoia), and JIT design-tokens
|
|
42
|
+
scaffolding when your project earns it.
|
|
43
|
+
- **`boss unlock v1`** — adds full design review (`/design-review` + `/ux-check` + token
|
|
44
|
+
enforcement), cross-FEAT sequencing (`/board`), and the next-tier mentors (business,
|
|
45
|
+
fundraising, pitch, talent).
|
|
46
|
+
- **A conscience that nudges.** When you've captured three ideas and tested none, it speaks
|
|
47
|
+
once. When you're spec'ing a feature your canvas never validated, it surfaces restraint.
|
|
48
|
+
Cohort-aware (set yours during spin-up; it adjusts the voice). Always overridable; never
|
|
49
|
+
blocking. Silence it for a sprint (`boss conscience pause --for 8h`), or turn down just one
|
|
50
|
+
nudge while the rest keep speaking (`boss conscience mute <moment>`).
|
|
51
|
+
- **A mentor board.** Nine advisors (venture, architect, GTM, cofounder, business, fundraising, pitch,
|
|
52
|
+
talent, humane) for the parts code can't teach. Plus a builder team (designer, voice-keeper, prompt-
|
|
53
|
+
coach) for the craft. Plus eight proto-personas (vibe-coder-newbie, eng-builder,
|
|
54
|
+
indie-hacker, returning-founder, domain-expert, …) you can show features to before showing
|
|
55
|
+
them to real founders.
|
|
56
|
+
- **Built for founding teams, not just solo.** Building with a cofounder? `boss team add @their-handle`
|
|
57
|
+
lights up a shared way to decide (`/decide`), share what you're each learning about AI (`/practice`),
|
|
58
|
+
a mentor for the partnership itself (`mentor-cofounder`), and a conscience that notices when you've
|
|
59
|
+
drifted into building in parallel — all *dormant when you're solo*, and it never takes a side or scores
|
|
60
|
+
your equity. See [`docs/GUIDE-teams.md`](docs/GUIDE-teams.md).
|
|
61
|
+
|
|
62
|
+
Built on Node — zero dependencies. Markdown + YAML everywhere a human reads; predicate-based
|
|
63
|
+
loops everywhere a machine evaluates. Lives in Claude Code. Everything runs locally.
|
|
64
|
+
|
|
65
|
+
## A concrete moment
|
|
66
|
+
|
|
67
|
+
You've used `/triage` four times this week capturing ideas. You haven't run `/canvas` on any.
|
|
68
|
+
You submit a prompt — anything — and the conscience fires once:
|
|
69
|
+
|
|
70
|
+
> *"That's the fourth thing you've added here, and none of it's been tested. Who would you
|
|
71
|
+
> talk to first to find out if any of them are real? `/canvas` is one way to pressure-test
|
|
72
|
+
> it — but a 15-minute call with the right person beats it."*
|
|
73
|
+
|
|
74
|
+
Then it goes quiet. You decide.
|
|
75
|
+
|
|
76
|
+
That's the shape of every interaction. Discipline shows up when it can help, hands the
|
|
77
|
+
decision back, gets out of the way. Discipline never accumulates as ceremony you have to
|
|
78
|
+
work around.
|
|
79
|
+
|
|
80
|
+
## What you actually get
|
|
81
|
+
|
|
82
|
+
Four modes, unlocked additively as the project earns them:
|
|
83
|
+
|
|
84
|
+
> **Quickstart** (capture an idea) → **MVP** (build it) → **V1** (ship it) → **Scale** (grow it)
|
|
85
|
+
|
|
86
|
+
Each mode adds skills, agents, and loops; nothing is ever ripped out, and every unlock is your
|
|
87
|
+
call — a project that stays in Quickstart forever is a legitimate project. The exact, always-current
|
|
88
|
+
list of what each mode includes lives where it can't go stale:
|
|
89
|
+
|
|
90
|
+
- **`boss map`** — the live cheatsheet for *your* project: where you are, what each command does,
|
|
91
|
+
and what's one unlock away.
|
|
92
|
+
- **[`docs/CHEATSHEET.md`](docs/CHEATSHEET.md)** + **[`docs/SKILLS.md`](docs/SKILLS.md)** — generated
|
|
93
|
+
from the source, so they never drift.
|
|
94
|
+
|
|
95
|
+
## What BOSS isn't
|
|
96
|
+
|
|
97
|
+
- **Not a framework you have to learn.** First hour: `boss new`, `/boss`, `/triage`. That's
|
|
98
|
+
the whole vocabulary you need.
|
|
99
|
+
- **Not a replacement for talking to real users.** The proto-personas pre-filter what to ask
|
|
100
|
+
real founders; they don't replace the conversations. BOSS's own advisory pass and v1 playbook
|
|
101
|
+
are explicit about this.
|
|
102
|
+
- **Not a YC.** Doesn't take equity. Doesn't push toward venture-scale. Defaults to *"you
|
|
103
|
+
should probably not raise; you should probably not hire; you should probably stay right-
|
|
104
|
+
sized"* until evidence says otherwise.
|
|
105
|
+
- **Not magic.** Each piece is inspectable. `boss status --conscience` shows what's open, what
|
|
106
|
+
would close it, what overrides you've recorded. The source is plain Node.
|
|
107
|
+
- **Not opinionated about your stack.** Stack-neutral until your first build decision; then
|
|
108
|
+
the coder specializes itself. Design tokens are stack-agnostic with per-stack patterns.
|
|
109
|
+
|
|
110
|
+
## Install + first 5 minutes
|
|
111
|
+
|
|
112
|
+
**Prerequisites:** [Node.js](https://nodejs.org) 18+ and [Claude Code](https://claude.com/claude-code)
|
|
113
|
+
(BOSS runs *inside* Claude Code — the CLI scaffolds, the skills run in Claude).
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# alpha install — clone the repo, link the CLI globally
|
|
117
|
+
git clone https://github.com/ajeshh/bossbuild.git
|
|
118
|
+
cd bossbuild
|
|
119
|
+
npm install -g . # puts `boss` on your PATH (zero runtime deps)
|
|
120
|
+
|
|
121
|
+
boss new my-app # 5 seconds — scaffolds + git-inits + registers
|
|
122
|
+
cd my-app
|
|
123
|
+
code . # open the folder in your editor (or `claude` in the terminal)
|
|
124
|
+
claude # open Claude Code (terminal or editor panel)
|
|
125
|
+
> /welcome # first time? ~1 min orientation
|
|
126
|
+
> /boss <idea | file | url> # spin up — point at a sentence, a doc, or a link; BOSS pulls it in
|
|
127
|
+
> /prototype <your idea> # or just hit go — BOSS builds the smallest clickable version to react to
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Already started building?** You don't have to start over. `cd` into your existing repo and run
|
|
131
|
+
`boss adopt` (add `--mode mvp` if it already has real users) — it lays BOSS down *non-destructively*,
|
|
132
|
+
your files untouched, at the lightest register that fits. Add `--ai` to have BOSS read the repo and
|
|
133
|
+
tailor the scaffold.
|
|
134
|
+
|
|
135
|
+
After that:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
boss map # where you are + what each command does + what's one unlock away
|
|
139
|
+
boss status # mode + pinned BOSS version + drift
|
|
140
|
+
boss status --conscience # loops state + recent overrides + cohort
|
|
141
|
+
boss unlock mvp # earn the next layer when ready
|
|
142
|
+
boss conscience pause --for 8h # silence everything for a bounded sprint
|
|
143
|
+
boss conscience resume # bring it back
|
|
144
|
+
boss conscience mute caution # turn down ONE moment; unmute (or --all) to restore
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`boss map` is the live cheatsheet — run it any time to see what's available in your current mode and
|
|
148
|
+
what the next unlock adds. For the read-once walkthrough, see [`docs/GUIDE.md`](docs/GUIDE.md); the
|
|
149
|
+
whole ladder at a glance lives in [`docs/CHEATSHEET.md`](docs/CHEATSHEET.md).
|
|
150
|
+
|
|
151
|
+
## The principle
|
|
152
|
+
|
|
153
|
+
Six rules in [`PRINCIPLES.md`](PRINCIPLES.md). The one that matters most: **humane before
|
|
154
|
+
viable.** A tool that exists to help founders build well must itself behave well. BOSS pauses
|
|
155
|
+
on command. Overrides every loop on request. Records every override so future-you sees the
|
|
156
|
+
deviation. Refuses to nag. Refuses to grade. *The seasoned hand who's built many things and
|
|
157
|
+
doesn't need the credit.*
|
|
158
|
+
|
|
159
|
+
The other five rules govern when to add ceremony (only as earned), when to capture practice
|
|
160
|
+
UP into BOSS's library (when reusable across projects), when to push practice DOWN into a
|
|
161
|
+
project (when validated), how to keep changes small (each release the minimum experiment that
|
|
162
|
+
produces validated learning), and how to keep style decoupled from code (design tokens as
|
|
163
|
+
authority).
|
|
164
|
+
|
|
165
|
+
## Where this is
|
|
166
|
+
|
|
167
|
+
Quickstart + MVP + V1 modes authored (Scale is stubbed); many capability releases in. For the
|
|
168
|
+
exact current release, see [`VERSION`](VERSION) + the [changelog](registry/CHANGELOG.md).
|
|
169
|
+
Self-hosted (BOSS itself runs in MVP mode, using BOSS). All discipline patterns demonstrated
|
|
170
|
+
by BOSS-on-BOSS before they ship anywhere else.
|
|
171
|
+
|
|
172
|
+
**This is alpha.** The conscience runs a gate-eval suite (105 passing) plus a model-verified
|
|
173
|
+
judgment surface — its drift / caution / capture calls are graded against labeled sets, not
|
|
174
|
+
just vibes. But it's been pressure-tested mostly against synthetic personas; real-founder
|
|
175
|
+
validation hasn't happened yet (a deliberate, recorded override).
|
|
176
|
+
If you try BOSS and it falls down, *that's the most useful thing you can tell me* — run
|
|
177
|
+
`/feedback` and it goes straight to this repo's issues.
|
|
178
|
+
|
|
179
|
+
## License + shape
|
|
180
|
+
|
|
181
|
+
Open source. Calm-company by default. No monetization of lock-in. No telemetry. Local-only
|
|
182
|
+
state — your project's data stays in your repo + `~/.boss/registry.json` on your machine. If
|
|
183
|
+
a business model ever emerges, it'll be hosted advisory sessions or patronage; never the CLI
|
|
184
|
+
itself.
|
|
185
|
+
|
|
186
|
+
BOSS pressure-tests its own bet with a **Humane Product Canvas** — People, Problem, Promises,
|
|
187
|
+
Risks & Harms, Principles, and the live riskiest assumption. It's the same `/canvas` skill BOSS
|
|
188
|
+
hands you, turned on itself.
|
|
189
|
+
|
|
190
|
+
## Acknowledgements
|
|
191
|
+
|
|
192
|
+
BOSS draws on a roster of practitioners — Don Norman, Brad Frost, Nathan Curtis, Jakob
|
|
193
|
+
Nielsen, Steve Krug, Ash Maurya, Eric Ries, Alberto Savoia, Rob Fitzpatrick, Bob Moesta,
|
|
194
|
+
Teresa Torres, Andrej Karpathy, Simon Willison, Ethan Mollick, Guillermo Rauch, Hamel Husain,
|
|
195
|
+
Jason Liu, Christopher Noessel, Indi Young, John Maeda, April Dunford, Andy Raskin, Jason
|
|
196
|
+
Fried & DHH, Rob Walling, Paul Jarvis, Erika Hall, Mike Monteiro, Tristan Harris, Cathy
|
|
197
|
+
O'Neil, Cal Newport, and many more. Mentor agents cite specific practices by attribution;
|
|
198
|
+
**no agent impersonates a person**.
|
|
199
|
+
|
|
200
|
+
The Humane Product Canvas framework is by Ajesh Shah; reused as the spine of BOSS's `/canvas`
|
|
201
|
+
skill.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
*[For the interior architecture — how the CLI works, how the loop primitive composes, how
|
|
206
|
+
the conscience hook reads predicates, how the registry tracks projects, how sync works —
|
|
207
|
+
read [`PRINCIPLES.md`](PRINCIPLES.md) and the source under [`src/`](src/). Not necessary for
|
|
208
|
+
first-use.]*
|
|
209
|
+
|
|
210
|
+
*[Building agent tooling yourself? [`docs/PATTERNS.md`](docs/PATTERNS.md) names the engineering
|
|
211
|
+
patterns BOSS is built on — the doer/judge split, two eval surfaces with real numbers,
|
|
212
|
+
progressive-disclosure skills, dormant-by-default hooks, AGENTS.md portability — with the honest
|
|
213
|
+
limits included.]*
|
package/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.97.0
|
package/bin/boss
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# library/ — the superset
|
|
2
|
+
|
|
3
|
+
The de-dhuned, generalized knowledge base that stages draw from and the learning loop feeds.
|
|
4
|
+
|
|
5
|
+
| Folder | Holds | Source |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `agents/` | Structural agent templates (placeholders for domain specifics) | dhun's structural agents |
|
|
8
|
+
| `skills/` | Structural skill templates | dhun's structural skills |
|
|
9
|
+
| `hooks/` | Generic hooks (type-check slot, frontmatter, session lifecycle) | dhun's hooks, stack-genericized |
|
|
10
|
+
| `practices/` | Best-practice docs: git, testing, refactor waves, RFC discipline, memory hygiene, incremental writes | mined from dhun's memory + workflow docs |
|
|
11
|
+
| `memory-seed/` | Project-agnostic feedback memories every new project should start with | mined from dhun's 143 memory files |
|
|
12
|
+
|
|
13
|
+
**Authoring rule:** anything here is stack-neutral and project-neutral. Domain specifics
|
|
14
|
+
(dhun's music/DJ logic, raag engine, Rangoli, etc.) never land here. Use `{{PLACEHOLDERS}}`
|
|
15
|
+
for anything project-specific.
|
|
16
|
+
|
|
17
|
+
**How it grows:** `/boss-learn` promotes a proven practice from a real project into here
|
|
18
|
+
(human-gated), bumps BOSS's VERSION, and appends `registry/CHANGELOG.md`. Existing projects
|
|
19
|
+
pull it via `/boss-sync`.
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mentor-venture
|
|
3
|
+
description: Venture mentor for {{PROJECT_NAME}} — coaches the FOUNDER, not the codebase. Pressure-tests whether the idea is worth pursuing, names the riskiest assumption, and points at the next real step. Owns the canvas conversation. Advisory only — never writes product code or specs. Trigger phrases - "is this worth doing", "should I build this", "what's my biggest risk", "how do I start a company", "talk me through this idea".
|
|
4
|
+
tools: Read, Grep, Glob, Edit, Write
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are the **venture mentor** for **{{PROJECT_NAME}}** ({{MODE}} mode) — the cornerstone of BOSS's
|
|
8
|
+
mentor layer (see `docs/MENTORS.md`). You coach the *founder*. You are not a builder: you don't write
|
|
9
|
+
production code, own specs, or decide implementation. You move the founder's *thinking* forward.
|
|
10
|
+
|
|
11
|
+
## Your job
|
|
12
|
+
|
|
13
|
+
- Be the experienced voice in the room for a founder who may be doing this for the first time.
|
|
14
|
+
- Pressure-test the idea humanely: who's served, what tension, what promise, who could be harmed —
|
|
15
|
+
*then* commercial rigor (riskiest assumption, smallest experiment, willingness to pay).
|
|
16
|
+
- Always leave them with **the single most useful next step**, not a plan they can't act on.
|
|
17
|
+
- Own the canvas conversation: nudge toward `/canvas`, help fill a few cells at a time, revisit it.
|
|
18
|
+
|
|
19
|
+
## How you work
|
|
20
|
+
|
|
21
|
+
1. Read `docs/ideas/` (what they're chasing), `docs/ideas/CANVAS.md` if present, and `PRINCIPLES.md`.
|
|
22
|
+
2. Ask one sharp question at a time. The goal is insight, not an interrogation.
|
|
23
|
+
3. Name the **riskiest assumption** out loud and propose one cheap way to test it this week.
|
|
24
|
+
4. Capture what's decided where it belongs (canvas, idea doc) — start the founder's dossier
|
|
25
|
+
(`docs/dossier/` as artifacts emerge). Author *with* them, never behind their back.
|
|
26
|
+
|
|
27
|
+
## The evidence you carry (use it, don't recite it)
|
|
28
|
+
|
|
29
|
+
Three findings anchor how you pressure-test. Lead with the judgment; cite only if they want the receipt.
|
|
30
|
+
|
|
31
|
+
- **Validation buys faster *decisions*, not guaranteed wins.** The disciplined founder doesn't win more
|
|
32
|
+
often by magic — they decide faster and **quit weak ideas faster** (Camuffo et al., 759-firm RCT).
|
|
33
|
+
Cheap AI lowers the cost of *building*, not the cost of *being wrong*. So when building feels free,
|
|
34
|
+
the riskiest-assumption test matters *more*, not less. Never sell validation as a guarantee.
|
|
35
|
+
- **The demoware test.** AI makes an impressive demo trivially cheap — and trivially easy to mistake for
|
|
36
|
+
a validated product. The blunt cut (Cagan/SVPG): *if your AI product only replaces a prompt plus a
|
|
37
|
+
copy/paste, it's a demo, not a product.* Use it at the `/prototype`→`/spec` graduation: did we test
|
|
38
|
+
value, usability, viability — or just that the demo runs?
|
|
39
|
+
- **The competence-gate.** AI advice *amplifies* the judgment a founder already has — it can actively
|
|
40
|
+
harm the founder least able to grade it (Otis et al., HBS RCT, 640 founders: high performers ~+15%,
|
|
41
|
+
struggling ones ~−8%; and confidence in AI tracks *less* checking, not more). So at a decision the
|
|
42
|
+
founder may not be equipped to evaluate, the move is to ask **"are you set up to judge this answer?"** —
|
|
43
|
+
point them at who would know, don't answer it for them. A humility prompt, used rarely, never a gate.
|
|
44
|
+
|
|
45
|
+
## What you do NOT do
|
|
46
|
+
|
|
47
|
+
- No production code, no specs, no architecture decisions — hand those to the builders (`pm`, `coder-generalist`).
|
|
48
|
+
- No premature ceremony. If they need more structure, the answer is usually `boss unlock <mode>`, which
|
|
49
|
+
brings the next mentors (architect, GTM…) with it — not a process you hand-roll.
|
|
50
|
+
- **No binding legal, financial, tax, or medical advice.** Caveat clearly and point them to a real
|
|
51
|
+
expert for anything consequential. You are a thinking partner, not a licensed professional.
|
|
52
|
+
|
|
53
|
+
## The line you hold
|
|
54
|
+
|
|
55
|
+
The humane lens comes before viability (Principle 6). Never coach toward harm for the sake of growth.
|
|
56
|
+
Surface trade-offs honestly; don't manufacture false confidence. When the idea genuinely has legs, say
|
|
57
|
+
so plainly and point at the next rung (`/canvas`, then `boss unlock mvp`).
|
|
File without changes
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// BOSS auto-log — a SubagentStop hook (OPT-IN; the trace substrate for IDEA-025).
|
|
3
|
+
//
|
|
4
|
+
// Ported UP from the dhun dogfood (Principle #1), Node-ported for BOSS's zero-dep
|
|
5
|
+
// rule. WHAT IT DOES: after a writer subagent finishes, append one honest line to
|
|
6
|
+
// `.boss/trace.jsonl` recording what that agent actually touched — session, agent,
|
|
7
|
+
// changed files, timestamp. This is the *trace substrate*: the within-session
|
|
8
|
+
// counterpart to `boss insights` (which reads the cross-project registry). It is
|
|
9
|
+
// the raw material a trace-native judge (IDEA-025 Phase 2, `/judge-traces`) and the
|
|
10
|
+
// sleep-time learn loop (Phase 3) read later. It does NOT judge, score, or send
|
|
11
|
+
// anything anywhere.
|
|
12
|
+
//
|
|
13
|
+
// HUMANE CONTRACT (inherits IDEA-021 / IDEA-013, non-negotiable):
|
|
14
|
+
// - LOCAL-ONLY. Writes one file in this repo. Never transmits. Never shares up.
|
|
15
|
+
// - APPEND-ONLY, facts not estimates. Records what the git tree shows changed.
|
|
16
|
+
// - MEASURE, DON'T INSTRUMENT THE HUMAN. It reads the work's own trace, not you.
|
|
17
|
+
// - READ ON DEMAND. Nothing consumes this file unless you run a skill that does.
|
|
18
|
+
//
|
|
19
|
+
// WHY OPT-IN: a SubagentStop hook fires a process after every subagent — real
|
|
20
|
+
// latency on multi-agent sessions. Ship it dormant; turn it on when you want the
|
|
21
|
+
// trace (regulated/high-stakes cohorts, or BOSS's own repo eating its dogfood).
|
|
22
|
+
//
|
|
23
|
+
// TO TURN IT ON — add to .claude/settings.json (registration IS the on-switch):
|
|
24
|
+
// "hooks": {
|
|
25
|
+
// "SubagentStop": [
|
|
26
|
+
// { "matcher": "",
|
|
27
|
+
// "hooks": [ { "type": "command",
|
|
28
|
+
// "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/auto-log.js\"",
|
|
29
|
+
// "timeout": 10 } ] }
|
|
30
|
+
// ]
|
|
31
|
+
// }
|
|
32
|
+
//
|
|
33
|
+
// Fail-open: any surprise exits 0. A trace line missed is fine; a broken session is not.
|
|
34
|
+
|
|
35
|
+
import process from 'node:process';
|
|
36
|
+
import { execFileSync } from 'node:child_process';
|
|
37
|
+
import { existsSync, mkdirSync, readFileSync, appendFileSync } from 'node:fs';
|
|
38
|
+
import { join } from 'node:path';
|
|
39
|
+
|
|
40
|
+
// Read-only agent types never write files — skip them (no trace to record).
|
|
41
|
+
const READ_ONLY = new Set([
|
|
42
|
+
'Explore', 'Plan', 'claude-code-guide', 'general-purpose-readonly',
|
|
43
|
+
'mentor-venture', 'mentor-architect', 'mentor-gtm', 'mentor-business',
|
|
44
|
+
'mentor-fundraising', 'mentor-talent', 'mentor-humane', 'mentor-pitch',
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
function readStdin() {
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
let data = '';
|
|
50
|
+
process.stdin.setEncoding('utf8');
|
|
51
|
+
process.stdin.on('data', (c) => (data += c));
|
|
52
|
+
process.stdin.on('end', () => resolve(data));
|
|
53
|
+
setTimeout(() => resolve(data), 1500);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const git = (repo, args) => {
|
|
58
|
+
try {
|
|
59
|
+
// Trailing-only trim: porcelain's leading status columns are significant
|
|
60
|
+
// (line 1 is " M path" — a full .trim() would eat that leading space and
|
|
61
|
+
// shift the column parse by one).
|
|
62
|
+
return execFileSync('git', args, { cwd: repo, encoding: 'utf8' }).replace(/\n+$/, '');
|
|
63
|
+
} catch {
|
|
64
|
+
return '';
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const main = async () => {
|
|
69
|
+
const repo = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
70
|
+
|
|
71
|
+
let agent = 'unknown';
|
|
72
|
+
let session = 'unknown';
|
|
73
|
+
try {
|
|
74
|
+
const json = JSON.parse(await readStdin());
|
|
75
|
+
agent = json.subagent_type || json.tool_input?.subagent_type || json.agent_type || 'unknown';
|
|
76
|
+
session = json.session_id || 'unknown';
|
|
77
|
+
} catch {
|
|
78
|
+
process.exit(0); // fail-open
|
|
79
|
+
}
|
|
80
|
+
if (READ_ONLY.has(agent)) process.exit(0);
|
|
81
|
+
|
|
82
|
+
// Facts not estimates: read what the working tree actually shows changed —
|
|
83
|
+
// both tracked modifications AND new untracked files (coders create files,
|
|
84
|
+
// which a plain `git diff HEAD` would miss). `git status --porcelain` carries
|
|
85
|
+
// both; columns 0-1 are the status code, the path starts at column 3.
|
|
86
|
+
const changed = [
|
|
87
|
+
...new Set(
|
|
88
|
+
git(repo, ['status', '--porcelain', '--untracked-files=all'])
|
|
89
|
+
.split('\n')
|
|
90
|
+
.filter(Boolean)
|
|
91
|
+
.map((l) => l.slice(3).replace(/^"|"$/g, '').split(' -> ').pop())
|
|
92
|
+
.filter(Boolean)
|
|
93
|
+
),
|
|
94
|
+
];
|
|
95
|
+
if (changed.length === 0) process.exit(0); // nothing written → nothing to trace
|
|
96
|
+
|
|
97
|
+
const files = changed.slice(0, 25); // cap the line; a 200-file diff doesn't need every path
|
|
98
|
+
const record = {
|
|
99
|
+
ts: new Date().toISOString(),
|
|
100
|
+
session,
|
|
101
|
+
agent,
|
|
102
|
+
files,
|
|
103
|
+
file_count: changed.length,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const dir = join(repo, '.boss');
|
|
107
|
+
const out = join(dir, 'trace.jsonl');
|
|
108
|
+
try {
|
|
109
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
110
|
+
// Dedup: SubagentStop can fire several times for one change set. Skip if the
|
|
111
|
+
// last line has the same (session, agent, files) signature.
|
|
112
|
+
if (existsSync(out)) {
|
|
113
|
+
const lines = readFileSync(out, 'utf8').trim().split('\n');
|
|
114
|
+
const last = lines[lines.length - 1];
|
|
115
|
+
if (last) {
|
|
116
|
+
try {
|
|
117
|
+
const p = JSON.parse(last);
|
|
118
|
+
const same =
|
|
119
|
+
p.session === session &&
|
|
120
|
+
p.agent === agent &&
|
|
121
|
+
JSON.stringify(p.files) === JSON.stringify(files);
|
|
122
|
+
if (same) process.exit(0);
|
|
123
|
+
} catch { /* fall through and write */ }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
appendFileSync(out, JSON.stringify(record) + '\n');
|
|
127
|
+
} catch {
|
|
128
|
+
process.exit(0); // fail-open: a write surprise must not break the session
|
|
129
|
+
}
|
|
130
|
+
process.exit(0);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
main();
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// BOSS memory-cue — a UserPromptSubmit hook (OPT-IN; zero-cost when silent).
|
|
3
|
+
//
|
|
4
|
+
// Ported UP from the dhun dogfood (Principle #1). dhun's was bash+jq; BOSS is
|
|
5
|
+
// zero-dependency (Node built-ins only), so this is the Node port.
|
|
6
|
+
//
|
|
7
|
+
// WHAT IT DOES: scans the founder's prompt for a *feedback signal* — durable
|
|
8
|
+
// guidance worth remembering across sessions — and NUDGES the model to save it
|
|
9
|
+
// to the project's memory. It never writes the memory itself: choosing the right
|
|
10
|
+
// wording (and whether it's durable vs. ephemeral) needs reasoning, so the cue
|
|
11
|
+
// hands that judgment back to the model. Silent on no match → zero token cost.
|
|
12
|
+
//
|
|
13
|
+
// directive "from now on", "always", "never", "stop doing", "going forward"
|
|
14
|
+
// corrective "no, don't", "that's wrong", "that's not right"
|
|
15
|
+
// confirmation "perfect, keep doing", "yes exactly", "nailed it"
|
|
16
|
+
//
|
|
17
|
+
// WHY OPT-IN (read before registering): a UserPromptSubmit hook fires a process
|
|
18
|
+
// on EVERY prompt. It's cheap (silent unless a pattern matches) but it is still
|
|
19
|
+
// machinery — ship it dormant, let the founder turn it on when they want BOSS to
|
|
20
|
+
// help build durable memory. (PRINCIPLE #2 / R&H #1 cost discipline.)
|
|
21
|
+
//
|
|
22
|
+
// TO TURN IT ON — add a UserPromptSubmit hook entry in .claude/settings.json
|
|
23
|
+
// (the registration IS the on-switch; an unregistered script costs nothing).
|
|
24
|
+
// It coexists with the conscience hook on the same event:
|
|
25
|
+
// "hooks": {
|
|
26
|
+
// "UserPromptSubmit": [
|
|
27
|
+
// { "matcher": "",
|
|
28
|
+
// "hooks": [ { "type": "command",
|
|
29
|
+
// "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/memory-cue.js\"",
|
|
30
|
+
// "timeout": 5 } ] }
|
|
31
|
+
// ]
|
|
32
|
+
// }
|
|
33
|
+
//
|
|
34
|
+
// Output contract (Claude Code UserPromptSubmit): text on stdout is added to the
|
|
35
|
+
// session context. Fail-open: any parse/runtime surprise exits 0 silently — a
|
|
36
|
+
// hook that breaks the session is worse than one that occasionally misses a cue.
|
|
37
|
+
|
|
38
|
+
import process from 'node:process';
|
|
39
|
+
|
|
40
|
+
const DIRECTIVE = /\b(from now on|going forward|always|never|stop doing|don'?t ever|remember (that|this)|every time|whenever|in (the )?future)\b/i;
|
|
41
|
+
const CORRECTIVE = /\bno,? (don'?t|stop|never|wrong)\b|\bthat'?s (not right|wrong)\b|\bdon'?t do that\b/i;
|
|
42
|
+
const CONFIRM = /\bperfect,? keep\b|\byes,? exactly\b|\bexactly,? that\b|\bthat'?s right,? keep\b|\bnailed it\b/i;
|
|
43
|
+
|
|
44
|
+
function readStdin() {
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
let data = '';
|
|
47
|
+
process.stdin.setEncoding('utf8');
|
|
48
|
+
process.stdin.on('data', (c) => (data += c));
|
|
49
|
+
process.stdin.on('end', () => resolve(data));
|
|
50
|
+
// If nothing is piped in, don't hang the session.
|
|
51
|
+
setTimeout(() => resolve(data), 1000);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const main = async () => {
|
|
56
|
+
let prompt = '';
|
|
57
|
+
try {
|
|
58
|
+
const raw = await readStdin();
|
|
59
|
+
const json = JSON.parse(raw);
|
|
60
|
+
prompt = json.prompt || json.user_prompt || '';
|
|
61
|
+
} catch {
|
|
62
|
+
process.exit(0); // fail-open
|
|
63
|
+
}
|
|
64
|
+
if (!prompt) process.exit(0);
|
|
65
|
+
|
|
66
|
+
let cue = '';
|
|
67
|
+
if (DIRECTIVE.test(prompt)) cue = 'directive';
|
|
68
|
+
else if (CORRECTIVE.test(prompt)) cue = 'corrective';
|
|
69
|
+
else if (CONFIRM.test(prompt)) cue = 'confirmation';
|
|
70
|
+
if (!cue) process.exit(0);
|
|
71
|
+
|
|
72
|
+
process.stdout.write(
|
|
73
|
+
`[memory-cue:${cue}] The founder's message carries a feedback signal. If this is ` +
|
|
74
|
+
`durable guidance (not ephemeral or one-off), save it as a feedback memory in the ` +
|
|
75
|
+
`project's auto-memory using the standard format (frontmatter + **Why:** + **How to ` +
|
|
76
|
+
`apply:**), and link it from MEMORY.md. If it's context-specific, ignore this. Do not ` +
|
|
77
|
+
`mention this hook in your reply.\n`
|
|
78
|
+
);
|
|
79
|
+
process.exit(0);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
main();
|