@agentshouse/kit 0.1.0-alpha.25 → 0.1.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +71 -25
  2. package/bin/connect-linux.sh +15 -4
  3. package/bootstrap.json +3 -3
  4. package/package.json +1 -1
  5. package/src/adapter-mcp.js +23 -1
  6. package/src/bridge.js +4 -0
  7. package/src/configuration.js +4 -0
  8. package/src/directory.js +6 -26
  9. package/src/how-we-work.md +25 -0
  10. package/src/launcher.js +11 -4
  11. package/src/mcp.js +5 -0
  12. package/src/skill-set/ask-matt/PHASE-BOUNDARIES.md +55 -0
  13. package/src/skill-set/ask-matt/SKILL.md +91 -0
  14. package/src/skill-set/ask-matt/agents/openai.yaml +4 -0
  15. package/src/skill-set/code-review/LICENSE +21 -0
  16. package/src/skill-set/code-review/SKILL.md +89 -0
  17. package/src/skill-set/code-review/agents/openai.yaml +3 -0
  18. package/src/skill-set/codebase-design/DEEPENING.md +37 -0
  19. package/src/skill-set/codebase-design/DESIGN-IT-TWICE.md +44 -0
  20. package/src/skill-set/codebase-design/LICENSE +21 -0
  21. package/src/skill-set/codebase-design/SKILL.md +116 -0
  22. package/src/skill-set/codebase-design/agents/openai.yaml +3 -0
  23. package/src/skill-set/diagnosing-bugs/LICENSE +21 -0
  24. package/src/skill-set/diagnosing-bugs/SKILL.md +140 -0
  25. package/src/skill-set/diagnosing-bugs/agents/openai.yaml +3 -0
  26. package/src/skill-set/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  27. package/src/skill-set/domain-modeling/ADR-FORMAT.md +47 -0
  28. package/src/skill-set/domain-modeling/CONTEXT-FORMAT.md +60 -0
  29. package/src/skill-set/domain-modeling/LICENSE +21 -0
  30. package/src/skill-set/domain-modeling/SKILL.md +76 -0
  31. package/src/skill-set/domain-modeling/agents/openai.yaml +3 -0
  32. package/src/skill-set/grill-me/LICENSE +21 -0
  33. package/src/skill-set/grill-me/SKILL.md +8 -0
  34. package/src/skill-set/grill-me/agents/openai.yaml +4 -0
  35. package/src/skill-set/grill-with-docs/LICENSE +21 -0
  36. package/src/skill-set/grill-with-docs/SKILL.md +8 -0
  37. package/src/skill-set/grill-with-docs/agents/openai.yaml +4 -0
  38. package/src/skill-set/grilling/LICENSE +21 -0
  39. package/src/{starter-set → skill-set}/grilling/SKILL.md +1 -1
  40. package/src/skill-set/handoff/LICENSE +21 -0
  41. package/src/skill-set/handoff/SKILL.md +17 -0
  42. package/src/skill-set/handoff/agents/openai.yaml +4 -0
  43. package/src/skill-set/implement/LICENSE +21 -0
  44. package/src/skill-set/implement/SKILL.md +16 -0
  45. package/src/skill-set/implement/agents/openai.yaml +4 -0
  46. package/src/skill-set/improve-codebase-architecture/HTML-REPORT.md +123 -0
  47. package/src/skill-set/improve-codebase-architecture/LICENSE +21 -0
  48. package/src/skill-set/improve-codebase-architecture/SKILL.md +72 -0
  49. package/src/skill-set/improve-codebase-architecture/agents/openai.yaml +4 -0
  50. package/src/skill-set/prototype/LICENSE +21 -0
  51. package/src/skill-set/prototype/LOGIC.md +67 -0
  52. package/src/skill-set/prototype/SKILL.md +28 -0
  53. package/src/skill-set/prototype/UI.md +112 -0
  54. package/src/skill-set/prototype/agents/openai.yaml +3 -0
  55. package/src/skill-set/research/LICENSE +21 -0
  56. package/src/skill-set/research/SKILL.md +14 -0
  57. package/src/skill-set/research/agents/openai.yaml +3 -0
  58. package/src/skill-set/resolving-merge-conflicts/LICENSE +21 -0
  59. package/src/skill-set/resolving-merge-conflicts/SKILL.md +16 -0
  60. package/src/skill-set/resolving-merge-conflicts/agents/openai.yaml +3 -0
  61. package/src/skill-set/tdd/LICENSE +21 -0
  62. package/src/skill-set/tdd/SKILL.md +40 -0
  63. package/src/skill-set/tdd/agents/openai.yaml +3 -0
  64. package/src/skill-set/tdd/mocking.md +59 -0
  65. package/src/skill-set/tdd/tests.md +77 -0
  66. package/src/skill-set/teach/GLOSSARY-FORMAT.md +35 -0
  67. package/src/skill-set/teach/LEARNING-RECORD-FORMAT.md +46 -0
  68. package/src/skill-set/teach/LICENSE +21 -0
  69. package/src/skill-set/teach/MISSION-FORMAT.md +31 -0
  70. package/src/skill-set/teach/RESOURCES-FORMAT.md +32 -0
  71. package/src/skill-set/teach/SKILL.md +141 -0
  72. package/src/skill-set/teach/agents/openai.yaml +4 -0
  73. package/src/skill-set/to-questionnaire/LICENSE +21 -0
  74. package/src/skill-set/to-questionnaire/SKILL.md +55 -0
  75. package/src/skill-set/to-questionnaire/agents/openai.yaml +4 -0
  76. package/src/skill-set/to-spec/LICENSE +21 -0
  77. package/src/skill-set/to-spec/SKILL.md +76 -0
  78. package/src/skill-set/to-spec/agents/openai.yaml +4 -0
  79. package/src/skill-set/to-tickets/LICENSE +21 -0
  80. package/src/skill-set/to-tickets/SKILL.md +106 -0
  81. package/src/skill-set/to-tickets/agents/openai.yaml +4 -0
  82. package/src/skill-set/wait-what/LICENSE +21 -0
  83. package/src/skill-set/wait-what/SKILL.md +8 -0
  84. package/src/skill-set/wait-what/agents/openai.yaml +4 -0
  85. package/src/skill-set/wayfinder/LICENSE +21 -0
  86. package/src/skill-set/wayfinder/SKILL.md +129 -0
  87. package/src/skill-set/wayfinder/agents/openai.yaml +4 -0
  88. package/src/skill-set/writing-for-agents/LICENSE +21 -0
  89. package/src/skill-set/writing-for-agents/SKILL-MECHANICS.md +22 -0
  90. package/src/skill-set/writing-for-agents/SKILL.md +83 -0
  91. package/src/skill-set/writing-for-agents/agents/openai.yaml +3 -0
  92. package/src/skill-set.js +85 -0
  93. package/src/worker.js +20 -8
  94. package/src/starter-set.js +0 -17
  95. /package/src/{starter-set/grilling → skill-set/ask-matt}/LICENSE +0 -0
  96. /package/src/{starter-set → skill-set}/grilling/agents/openai.yaml +0 -0
package/README.md CHANGED
@@ -4,12 +4,15 @@ House Kit is a public package repository. Product development is planned and
4
4
  coordinated in the [Agents House repository](https://github.com/trof3039/agents.house);
5
5
  this repository contains only the package source and its operator documentation.
6
6
 
7
+ The Skill set Kit installs is Matt Pocock's
8
+ [`mattpocock/skills`](https://github.com/mattpocock/skills); thank you, Matt.
9
+
7
10
  ## Connect a Linux computer
8
11
 
9
12
  On Linux `amd64` or `arm64`, run the published, versioned bootstrap once:
10
13
 
11
14
  ```sh
12
- bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.25/connect-linux.sh)
15
+ bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.26/connect-linux.sh)
13
16
  ```
14
17
 
15
18
  The bootstrap first establishes Docker Engine from what it observes on the
@@ -40,7 +43,10 @@ and starts the container with Docker's `unless-stopped` lifecycle. Pass
40
43
  `--workspace /absolute/path` for one other workspace root or `--manual` for
41
44
  the existing URL and one-time-code login route. `--house <origin>` selects
42
45
  another House and is retained in Kit home. A repeated invocation reuses the
43
- same container, credential and Environment.
46
+ same container, credential and Environment. Every invocation that is not a
47
+ forwarded command also sets `skills` in Kit's configuration: `--no-skills`
48
+ declines [the Skill set](#the-skill-set) and an invocation without it accepts
49
+ the set again.
44
50
 
45
51
  Running a newer release's bootstrap the same way is the only update. When the
46
52
  installed container runs another image, the bootstrap pulls this release's
@@ -227,7 +233,8 @@ never printed by Kit.
227
233
  "settings": "/home/ada/.claude/settings.json"
228
234
  }
229
235
  ],
230
- "host": null
236
+ "host": null,
237
+ "skills": true
231
238
  }
232
239
  ```
233
240
 
@@ -254,6 +261,11 @@ service owns the command that produces it.
254
261
  no capacity; the section is required like the others, so a host is measured only
255
262
  where the Environment owner says so.
256
263
 
264
+ `skills` is this Environment's choice of [the Skill set](#the-skill-set):
265
+ `true` accepts it and `false` declines it. A configuration that omits it
266
+ accepts the set. The bootstrap writes it on every invocation that is not a
267
+ forwarded command.
268
+
257
269
  `clients` is the local Agent client catalogue and never leaves the installation.
258
270
  Each entry names one client whose lifecycle hook configuration this Kit
259
271
  reconciles: `kind` is `claude-code`, the one client this Kit installs a hook
@@ -395,7 +407,8 @@ them all, and no instance can read another's provider credential.
395
407
  }
396
408
  ],
397
409
  "clients": [],
398
- "host": null
410
+ "host": null,
411
+ "skills": false
399
412
  }
400
413
  ```
401
414
 
@@ -653,27 +666,12 @@ inside `/agents/house` is somebody else's default or an owner's own workspace,
653
666
  never this Agent's. Every path that is not this exact equality, one deeper
654
667
  inside `/agents/house` included, must
655
668
  already exist in this Environment as a directory the installation can enter;
656
- Kit never creates or seeds it.
657
-
658
- When the Agent's own default directory is absent, Kit builds the starter set in
659
- a temporary directory beneath the base and renames it into place as one atomic
660
- step, so a partly seeded directory is never visible at the default path. Two
661
- concurrent first launches race that rename; the loser discards its temporary
662
- directory and uses the directory the winner put there, so the pair still leaves
663
- one complete directory and nothing partial. A present default directory -
664
- including one whose starter files the owner edited or removed - launches
665
- exactly as it is, and a deleted default directory is recreated with a fresh
666
- starter set on its next launch.
667
-
668
- The starter set is `AGENTS.md` with the single line ``The agents.house `house`
669
- CLI is available: run `house --help`.``, `CLAUDE.md` as a relative symbolic link to it, `.agents/skills/grilling/`
670
- vendored from [`mattpocock/skills`](https://github.com/mattpocock/skills)
671
- `skills/productivity/grilling` at a pinned commit with its MIT license and a
672
- provenance header naming that commit, and `.claude/skills` as a relative
673
- symbolic link to `.agents/skills`. Once seeded the files belong to the owner:
674
- Kit never syncs, refreshes, or restores them, and refreshing the vendored skill
675
- for new Agents is an ordinary Kit release that never touches an already seeded
676
- directory.
669
+ Kit never creates it.
670
+
671
+ When the Agent's own default directory is absent, Kit creates it empty; two
672
+ concurrent first launches create the same directory. A present default
673
+ directory launches exactly as it is, and a deleted one is created empty again
674
+ on its next launch. Kit writes no file into any working directory.
677
675
 
678
676
  A relative, missing, inaccessible, or non-directory working directory refuses
679
677
  with `kit_launch_directory_unavailable` before any provider process starts. Kit falls back to no other location - not the
@@ -681,6 +679,52 @@ base, not `$HOUSE_KIT_HOME`, and not its own current directory - and neither
681
679
  connecting an installation nor launching a session moves, copies, overwrites,
682
680
  or removes anything a working directory holds.
683
681
 
682
+ ## The Skill set
683
+
684
+ The Skill set is every skill the `mattpocock/skills` plugin manifest names at
685
+ one pinned commit but `setup-matt-pocock-skills`, `triage` and `wizard`. Each
686
+ is vendored under `src/skill-set/<name>/` with every file it ships, the
687
+ upstream MIT `LICENSE` and a provenance header in `SKILL.md` naming the commit
688
+ and upstream path. Nothing else is edited but two lines: a
689
+ `disable-model-invocation: true` frontmatter line in `SKILL.md` and an
690
+ `allow_implicit_invocation: false` line in `agents/openai.yaml` are removed, so
691
+ an agent reaches every skill without being told its name.
692
+
693
+ Kit installs the Skill set once for the Environment, for every Agent whatever
694
+ its working directory, under the home it launches agent CLIs with: each skill
695
+ as the directory `$HOME/.agents/skills/<name>`, which Codex and Grok Build
696
+ read, and a relative symbolic link `$HOME/.claude/skills/<name>` to it, which
697
+ Claude Code reads; when `$HOME/.claude/skills` already resolves to
698
+ `$HOME/.agents/skills`, Claude Code reads the directory there and Kit makes no
699
+ link. In a container that home is Kit home, so the set survives
700
+ container recreation; on a native host it is the host user's home.
701
+
702
+ `$HOUSE_KIT_HOME/state/skill-set.json` records the names Kit installed and the
703
+ Kit version that installed them, and Kit owns exactly those names: the
704
+ directory and the link of each. At start and on every resident pass, when
705
+ the set is accepted and the record names another version or none, Kit deletes
706
+ every recorded name, installs the current Skill set and rewrites the record. A
707
+ name whose directory or link exists without being recorded is the owner's: Kit
708
+ leaves it untouched and installs nothing under it. Kit never compares, merges
709
+ or restores a file, so an edit to an installed skill is lost at the next
710
+ release and a copy under another name is kept. When `skills` is `false`, Kit
711
+ deletes every recorded name and the record and installs nothing.
712
+
713
+ After Kit first installs the Skill set, the first Session it launches whose
714
+ Profile ceiling lets it write the owner's How-we-work document
715
+ `/private/library/how-we-work.md` creates it, when it is absent, with the text
716
+ Kit ships in `src/how-we-work.md`, over the Session's own bridge before its
717
+ first prompt is built. Kit then notes in `$HOUSE_KIT_HOME/state/how-we-work`,
718
+ apart from the record, that the document exists, and a present document is
719
+ noted the same way without being touched. Nothing ever creates it again: a
720
+ release, a declined Skill set and a later acceptance leave the note, so an
721
+ owner's edit stands and a deleted document stays deleted. A Session whose
722
+ ceiling cannot write the document launches without it and leaves it for the
723
+ next one; any other refused creation refuses the attempt as
724
+ `kit_how_we_work_unwritable` with House's answer before a prompt is sent. A
725
+ Skill set Kit cannot install or remove refuses the pass as
726
+ `kit_skill_set_unavailable` and names the path.
727
+
684
728
  ## The declared agent CLIs
685
729
 
686
730
  The Environment owner installs no adapter binary by hand. `kit agents update`
@@ -1708,6 +1752,8 @@ $HOUSE_KIT_HOME/
1708
1752
  state/conversation-originals/<attachment identity>.json
1709
1753
  state/sessions/<tmux session>.json
1710
1754
  state/update-drain
1755
+ state/skill-set.json
1756
+ state/how-we-work
1711
1757
  state/continuations/<run identity>.json
1712
1758
  state/<instance>/credentials/google.json
1713
1759
  state/<instance>/checkpoints/<service>.json
@@ -6,6 +6,7 @@ NAME='house-kit'
6
6
  HOUSE='https://agents.house'
7
7
  WORKSPACE="$HOME/AgentsHouse"
8
8
  MANUAL=0
9
+ SKILLS=true
9
10
  WORKSPACE_SELECTED=0
10
11
  HOUSE_SELECTED=0
11
12
  FORWARDING=0
@@ -160,6 +161,10 @@ while (($#)); do
160
161
  MANUAL=1
161
162
  shift
162
163
  ;;
164
+ --no-skills)
165
+ SKILLS=false
166
+ shift
167
+ ;;
163
168
  *) refuse "unknown argument $1" ;;
164
169
  esac
165
170
  done
@@ -208,6 +213,16 @@ if [[ -f "$KIT_HOME/house" ]]; then
208
213
  HOUSE="$BOUND_HOUSE"
209
214
  fi
210
215
  [[ "$HOUSE" == https://* || "$HOUSE" == http://127.0.0.1:* || "$HOUSE" == http://localhost:* ]] || refuse 'House origin must use HTTPS or local loopback HTTP'
216
+ if ((FORWARDING == 0)); then
217
+ if [[ ! -f "$KIT_HOME/kit.json" ]]; then
218
+ printf '{"availability":"intermittent","execution_authority":"allow","migrators":[],"instances":[],"clients":[],"host":null,"skills":%s}\n' "$SKILLS" > "$KIT_HOME/kit.json"
219
+ elif grep -Eq '"skills"[[:space:]]*:' "$KIT_HOME/kit.json"; then
220
+ sed -E -i "s/(\"skills\"[[:space:]]*:[[:space:]]*)(true|false)/\\1$SKILLS/" "$KIT_HOME/kit.json" || refuse 'kit.json could not be updated'
221
+ else
222
+ sed -E -i "1s/^([[:space:]]*)\\{/\\1{\"skills\":$SKILLS,/" "$KIT_HOME/kit.json" || refuse 'kit.json could not be updated'
223
+ fi
224
+ grep -Eq "\"skills\"[[:space:]]*:[[:space:]]*$SKILLS" "$KIT_HOME/kit.json" || refuse 'kit.json could not be updated'
225
+ fi
211
226
  DOCKER_RUN=(docker run --rm --network host --user "$(id -u):$(id -g)" --mount "$KIT_HOME_MOUNT" --mount "$WORKSPACE_MOUNT" --env HOME=/kit-home --env HOUSE_KIT_HOME=/kit-home --env HOUSE_KIT_CONTAINER=1 --env "HOUSE_KIT_HOSTNAME=$(hostname)" "$IMAGE")
212
227
 
213
228
  if docker container inspect "$NAME" >/dev/null 2>&1; then
@@ -271,10 +286,6 @@ fi
271
286
 
272
287
  docker pull --quiet --platform "linux/$ARCH" "$IMAGE" >/dev/null
273
288
 
274
- if [[ ! -f "$KIT_HOME/kit.json" ]]; then
275
- printf '{"availability":"intermittent","execution_authority":"allow","migrators":[],"instances":[],"clients":[],"host":null}\n' > "$KIT_HOME/kit.json"
276
- fi
277
-
278
289
  if [[ -f "$KIT_HOME/credential" ]]; then
279
290
  "${DOCKER_RUN[@]}" credential check
280
291
  else
package/bootstrap.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.1.0-alpha.25",
3
+ "version": "0.1.0-alpha.26",
4
4
  "hosts": {
5
5
  "linux": {
6
- "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.25/connect-linux.sh)",
6
+ "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.26/connect-linux.sh)",
7
7
  "asset": {
8
8
  "name": "connect-linux.sh",
9
- "url": "https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.25/connect-linux.sh"
9
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.1.0-alpha.26/connect-linux.sh"
10
10
  },
11
11
  "workspace": {
12
12
  "argument": "--workspace",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/kit",
3
- "version": "0.1.0-alpha.25",
3
+ "version": "0.1.0-alpha.26",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,12 +1,15 @@
1
+ import { readFileSync } from "node:fs";
1
2
  import {
2
3
  COMMAND_ADAPTER_INITIALIZE_TIMEOUT_MS,
3
4
  HOW_WE_WORK_PATH,
4
5
  MCP_PROTOCOL_VERSION,
5
6
  SHELL_RENDER,
6
7
  } from "./contract.js";
7
- import { answerText, bridgeCall } from "./mcp.js";
8
+ import { answerText, bridgeCall, editRefusal } from "./mcp.js";
8
9
  import { KitRefusal } from "./refusal.js";
9
10
 
11
+ const HOW_WE_WORK_TEXT = readFileSync(new URL("how-we-work.md", import.meta.url), "utf8");
12
+
10
13
  function readableDiscovery(discovery) {
11
14
  const identity = discovery?._meta?.["io.modelcontextprotocol/serverInfo"];
12
15
  return Array.isArray(discovery?.supportedVersions) &&
@@ -84,3 +87,22 @@ export async function commandHouseHowWeWork(bridge) {
84
87
  } while (cursor !== null);
85
88
  return pages.join("\n");
86
89
  }
90
+
91
+ export async function commandHouseCreateHowWeWork(bridge) {
92
+ const frame = await bridgeCall(bridge, {
93
+ method: "tools/call",
94
+ params: {
95
+ name: "edit",
96
+ arguments: { changes: [{ op: "create", path: HOW_WE_WORK_PATH, content: HOW_WE_WORK_TEXT }] },
97
+ },
98
+ });
99
+ if (frame.error !== undefined) {
100
+ throw new KitRefusal("kit_how_we_work_unwritable", frame.error.message ?? null);
101
+ }
102
+ if (frame.result?.isError !== true) return true;
103
+ const text = answerText(frame.result);
104
+ const { code, conflicts } = editRefusal(text);
105
+ if (code === "room_not_found" || code === "operation_denied") return false;
106
+ if (code === "edit_conflict" && conflicts?.some((conflict) => conflict.code === "path_exists")) return true;
107
+ throw new KitRefusal("kit_how_we_work_unwritable", text);
108
+ }
package/src/bridge.js CHANGED
@@ -228,6 +228,10 @@ export async function openBridge(options) {
228
228
  else void Promise.resolve(reported).finally(() => state.interrupts.delete(frame.interrupt));
229
229
  return;
230
230
  }
231
+ if (frame.type === "how_we_work") {
232
+ void options.howWeWork?.();
233
+ return;
234
+ }
231
235
  if (frame.type === "turn_ended") {
232
236
  state.stop = {
233
237
  providerContinuation: frame.provider_continuation === true,
@@ -388,6 +388,7 @@ export function parseConfiguration(document) {
388
388
  "migrators",
389
389
  "clients",
390
390
  "host",
391
+ "skills",
391
392
  ],
392
393
  "configuration",
393
394
  );
@@ -397,6 +398,8 @@ export function parseConfiguration(document) {
397
398
  if (!EXECUTION_AUTHORITIES.includes(declared.execution_authority)) {
398
399
  refuse("execution_authority");
399
400
  }
401
+ const skills = declared.skills === undefined ? true : declared.skills;
402
+ if (typeof skills !== "boolean") refuse("skills");
400
403
  if (!Array.isArray(declared.instances)) refuse("instances");
401
404
  if (!Array.isArray(declared.migrators)) refuse("migrators");
402
405
  const instances = declared.instances.map((instance, position) =>
@@ -428,6 +431,7 @@ export function parseConfiguration(document) {
428
431
  migrators,
429
432
  clients,
430
433
  host: hostOf(declared.host, "host"),
434
+ skills,
431
435
  };
432
436
  }
433
437
 
package/src/directory.js CHANGED
@@ -1,10 +1,8 @@
1
1
  import { constants } from "node:fs";
2
- import { access, mkdir, realpath, rename, rm, stat } from "node:fs/promises";
3
- import { randomUUID } from "node:crypto";
4
- import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
2
+ import { access, mkdir, realpath, stat } from "node:fs/promises";
3
+ import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
5
4
  import { LAUNCH_DIRECTORY_BASE } from "./contract.js";
6
5
  import { KitRefusal } from "./refusal.js";
7
- import { seedStarterSet } from "./starter-set.js";
8
6
 
9
7
  export function launchBase(dependencies = {}) {
10
8
  return dependencies.launchBase ?? LAUNCH_DIRECTORY_BASE;
@@ -39,25 +37,9 @@ function unavailable(path, cause) {
39
37
  return new KitRefusal("kit_launch_directory_unavailable", `${path} ${cause}`);
40
38
  }
41
39
 
42
- async function isDirectory(path) {
43
- try {
44
- return (await stat(path)).isDirectory();
45
- } catch {
46
- return false;
47
- }
48
- }
49
-
50
- async function seedDefaultDirectory(selected, base, path) {
51
- const staging = join(base, `.${randomUUID()}.staging`);
52
- try {
53
- await seedStarterSet(staging);
54
- await rename(staging, path);
55
- } catch (error) {
56
- await rm(staging, { recursive: true, force: true }).catch(() => undefined);
57
- if (!(await isDirectory(path))) {
58
- throw unavailable(selected, `could not be prepared (${error.code ?? "unknown"})`);
59
- }
60
- }
40
+ async function createDefaultDirectory(selected, path) {
41
+ const refused = await made(path);
42
+ if (refused !== null) throw unavailable(selected, `could not be created (${refused})`);
61
43
  }
62
44
 
63
45
  function within(base, selected) {
@@ -73,9 +55,7 @@ export async function readyLaunchDirectory(selected, base, agentId = null, optio
73
55
  if (options.container && !within(resolve(base), path)) {
74
56
  throw unavailable(selected, `resolves outside ${base}`);
75
57
  }
76
- if (path === defaultDirectory(base, agentId) && !(await isDirectory(path))) {
77
- await seedDefaultDirectory(selected, base, path);
78
- }
58
+ if (path === defaultDirectory(base, agentId)) await createDefaultDirectory(selected, path);
79
59
  let described;
80
60
  try {
81
61
  described = await stat(path);
@@ -0,0 +1,25 @@
1
+ # How we work
2
+
3
+ A Room is where information people share is kept; it is not the place for
4
+ private information. Work goes into the Room it belongs to, or the First Room
5
+ when none is named. Read and write Rooms with the `house` CLI.
6
+
7
+ The skills are already set up; never run `setup-matt-pocock-skills`.
8
+
9
+ ## Where skill output goes
10
+
11
+ - Glossary (`CONTEXT.md`): `library/glossary.md`
12
+ - Decisions (ADRs): `library/decisions/NNNN-<slug>.md`
13
+ - Plan (spec): `library/projects/<name>/plan.md`
14
+ - Tasks (tickets): `library/projects/<name>/tasks/NN-<slug>.md`, with a
15
+ `Status:` line (`needs-triage`, `needs-info`, `ready-for-agent`,
16
+ `ready-for-human`, `wontfix`), a `Blocked by:` line and comments under
17
+ `## Comments`
18
+ - Map (Wayfinding): `library/projects/<name>/map.md`, its tasks under
19
+ `tasks/` with `Type:`, `Status: claimed|resolved` and `Blocked by:` lines
20
+ - Research: `library/research/<slug>.md`
21
+ - Questionnaires: `library/questionnaires/<slug>.md`
22
+ - Learning: `library/learning/<topic>/`
23
+ - Files a person should open, such as HTML pages, are uploaded to the Room and
24
+ linked from the document they belong to; a prototype is one HTML file with
25
+ every variant on one page.
package/src/launcher.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { commandHouseHowWeWork, commandHouseInstructions } from "./adapter-mcp.js";
2
+ import {
3
+ commandHouseCreateHowWeWork,
4
+ commandHouseHowWeWork,
5
+ commandHouseInstructions,
6
+ } from "./adapter-mcp.js";
3
7
  import {
4
8
  compiledContract,
5
9
  initializeCommandAdapter,
@@ -129,8 +133,11 @@ async function configureSession(acp, contract, sessionId, adapter) {
129
133
  }
130
134
  }
131
135
 
132
- async function sessionOpening(bridge, baseInstructions) {
133
- const parts = [HOUSE_CLI_LINE, baseInstructions, await commandHouseHowWeWork(bridge)];
136
+ async function sessionOpening(channel, bridge, start) {
137
+ if (start.create_how_we_work === true && (await commandHouseCreateHowWeWork(bridge))) {
138
+ channel.send({ type: "how_we_work" });
139
+ }
140
+ const parts = [HOUSE_CLI_LINE, start.base_instructions, await commandHouseHowWeWork(bridge)];
134
141
  return [{ type: "text", text: parts.filter((part) => part.trim() !== "").join("\n\n") }];
135
142
  }
136
143
 
@@ -185,7 +192,7 @@ async function runTurn(channel, start, bridge, turn) {
185
192
  const instructions = await commandHouseInstructions(bridge);
186
193
  let providerSessionId = start.provider_session ?? null;
187
194
  const opening =
188
- providerSessionId === null ? await sessionOpening(bridge, start.base_instructions) : [];
195
+ providerSessionId === null ? await sessionOpening(channel, bridge, start) : [];
189
196
  const setup = { cwd: start.working_directory, mcpServers: [] };
190
197
  if (providerSessionId === null) {
191
198
  providerSessionId = openedSession(await acp.request("session/new", setup));
package/src/mcp.js CHANGED
@@ -82,3 +82,8 @@ export function answerYaml(text) {
82
82
  return null;
83
83
  }
84
84
  }
85
+
86
+ export function editRefusal(text) {
87
+ const conflicts = answerYaml(text.slice(text.indexOf("\n") + 1))?.conflicts;
88
+ return { code: text.split(":")[0].trim(), conflicts: Array.isArray(conflicts) ? conflicts : null };
89
+ }
@@ -0,0 +1,55 @@
1
+ # Phase boundaries
2
+
3
+ A **phase** is a chunk of work inside a session: the grilling, the implementation, the QA. The definition is fuzzy on purpose: a phase ends when you think *"ok, we're done with that"*.
4
+
5
+ The **phase boundary** is the gap between two phases, and it is the only place this decision belongs. Mid-phase there is no decision to make: continue, or split the work that's left into subagents. Compacting mid-phase makes the agent lose the thread.
6
+
7
+ ## The five options
8
+
9
+ | Option | What it does |
10
+ | ------------ | --------------------------------------------------------------- |
11
+ | **Continue** | Stay in the session. No context switch at all. |
12
+ | **`/clear`** | Empty the context window and start from nothing. |
13
+ | **`/handoff`** | Write a portable markdown file and seed a session anywhere with it. |
14
+ | **Subagent** | Send the task to its own context window and get a report back. |
15
+ | **`/compact`** | Compress this context and seed a fresh session with the summary. |
16
+
17
+ ## The tree
18
+
19
+ Work top to bottom at the boundary. The first **yes** wins.
20
+
21
+ **1. Can you continue in this session?** Two things make the answer yes: the next phase needs this phase as a **primary source**, or you have enough [smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone) left (~150k tokens) for the next phase to fit. Grilling → implementation is the standard yes: the implementation wants the reasoning verbatim, not a summary of it. Continue costs nothing and loses nothing, so rule it out before anything else.
22
+
23
+ **2. Is the context irrelevant to what comes next?** Is everything in this session (the exploration, the decisions, the dead ends) disposable? If so, **`/clear`**. It is the cheapest move on the board: it takes no time and hands back the whole window. `/clear` also isn't terminal: the old session stays resumable.
24
+
25
+ The cost of getting this wrong is one-way. Clear a *relevant* context and you lose the **why** behind what you built, and no amount of reading the diff back gets it returned.
26
+
27
+ **3. Do you need to hand off?** `/handoff` is narrow. You need it only when you are:
28
+
29
+ - swapping to a **new harness** (Claude → Codex),
30
+ - moving to a **new directory** or repo,
31
+ - sending the work to a **colleague**,
32
+ - or forking a side task you found **mid-phase** without derailing what you're doing.
33
+
34
+ That list is the whole clause. What `/handoff` buys is **portability**: a file that travels. If nothing is travelling, you don't need it.
35
+
36
+ **4. Can the task be done AFK?** Is it scoped tightly enough to run with you away from the keyboard, no steering? Then send it to a **subagent** and leave this session untouched. Automated review is the standard case: the agent reads the diff and reports, and you aren't needed while it does.
37
+
38
+ **5. Otherwise, `/compact`.** Relevant context, same harness, same directory, and you need to stay in the loop: this is where the tree lands, and it lands here often. Pass it an instruction (`/compact we're going to QA this area`) so the summary keeps what the next phase needs.
39
+
40
+ `/compact` is the **default, not the first reach**. It sits at the bottom because the four questions above it are all cheaper or more precise. The failure mode when people start here is a fresh session that is confidently wrong about a decision the summary flattened.
41
+
42
+ ## Primary and secondary sources
43
+
44
+ Every move except **Continue** turns a **primary source** into a **secondary source**: the session as it happened, replaced by a summary of it. The trade is always the same shape:
45
+
46
+ | Source | Information | Noise | Room to move |
47
+ | --------------------------------- | ----------- | ----- | ------------ |
48
+ | Primary (Continue) | Full | Lots | Little |
49
+ | Secondary (`/compact`, `/handoff`) | Lossy | Less | Lots |
50
+
51
+ This is why question 1 comes first. You only pay the lossiness when staying costs more than it saves.
52
+
53
+ ## These are judgement calls
54
+
55
+ The questions are not objective: each has taste in it, and the same boundary can go two ways on two days. The value is in asking them **in order**, at the boundary rather than in the middle of the work.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: ask-matt
3
+ description: Ask which skill or flow fits your situation. A router over the skills in this repo.
4
+ ---
5
+
6
+ <!-- Vendored from mattpocock/skills at commit c55ee46073ed923f86ce59a5eb3b6d895095d1b7 (skills/engineering/ask-matt). MIT licensed — see LICENSE in this directory. -->
7
+
8
+ # Ask Matt
9
+
10
+ You don't remember every skill, so ask.
11
+
12
+ A **flow** is a path through the skills. Most paths run along one **main flow**, and two **on-ramps** merge onto it. Everything else is standalone, or a vocabulary layer that runs underneath.
13
+
14
+ ## The main flow: idea → ship
15
+
16
+ The route most work travels. You have an idea and want it built.
17
+
18
+ 1. **`/grill-with-docs`** sharpens the idea by interview. Start here whenever you are **working in a working directory**: it's stateful, retaining what it learns in `CONTEXT.md` and ADRs. (No working directory? Use `/grill-me` instead, covered under Standalone. Both run the same `/grilling` primitive; `grill-with-docs` is the one that leaves a paper trail, which makes it the better of the two whenever a repo is there to leave it in.)
19
+ 2. **Branch: can you settle every question in conversation?** If a question needs a runnable answer (state, business logic, a UI you have to see), detour through a prototype, bridged by **`/handoff`** in both directions (a prototype lives in its own directory, which is exactly what `/handoff` is for; see Phase boundaries):
20
+ - **`/handoff`** out, then open a fresh session against that file,
21
+ - **`/prototype`** to answer the question with throwaway code,
22
+ - **`/handoff`** back what you learned, and reference it from the original idea thread.
23
+ 3. **Branch: is this a multi-session build?**
24
+ - **Yes** → **`/to-spec`** (turn the thread into a spec), then **`/to-tickets`** to split it into tracer-bullet tickets, each declaring its **blocking edges**. On a local tracker that's one file per ticket under `.scratch/<feature>/issues/`, worked blockers-first by hand; on a real tracker the edges become native blocking links, so any ticket whose blockers are done can be grabbed: kick off **`/implement`** per ticket, **`/clear`ing context between each one**. Each ticket is self-contained, so the last one's context is disposable.
25
+ - **No** → **`/implement`** right here, in the same context window.
26
+
27
+ Either way, **`/implement`** builds each issue by driving **`/tdd`** internally (one red-green slice at a time), then closes out by running **`/code-review`**, a two-axis review (Standards + Spec) of the diff, before committing. Reach for **`/tdd`** on its own when you just want to build a concrete behaviour test-first without a full spec, and **`/code-review`** on its own whenever you want to review a branch or PR against a fixed point.
28
+
29
+ ### Context hygiene
30
+
31
+ Keep steps 1–3 in **one unbroken context window** (don't compact or clear until after `/to-tickets`) so the grilling, spec, and tickets all build on the same thinking. Each `/implement` then starts fresh, working from the ticket.
32
+
33
+ The limit on this is the **[smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone)**: the window (~150k tokens on state-of-the-art models) within which the model still reasons sharply. If a session approaches it before `/to-tickets`, don't push on degraded; `/compact` at the nearest phase boundary and carry on (see Phase boundaries).
34
+
35
+ ## On-ramps
36
+
37
+ A starting situation that generates work, then merges onto the main flow.
38
+
39
+ - **Bugs and requests piling up** → **`/triage`**. It moves issues through triage roles and produces agent-ready issues, which **`/implement`** later picks up.
40
+
41
+ Triage is only for issues **you didn't create**: bug reports, incoming feature requests, anything that arrives raw. Tickets that `/to-tickets` produced are already agent-ready, so **don't triage them**.
42
+
43
+ - **Something's broken** → **`/diagnosing-bugs`**. For the hard ones: the bug that resists a first glance, the intermittent flake, the regression that crept in between two known-good states. It refuses to theorise until it has a **tight feedback loop** (one command that already goes red on *this* bug), then fixes with a regression test. Its post-mortem hands off to **`/improve-codebase-architecture`** when the real finding is that there's no good seam to lock the bug down.
44
+
45
+ - **A huge, foggy effort: a greenfield project or a huge feature build, too big for one session** → **`/wayfinder`**, the most cognitively demanding flow here. When the way from here to the destination isn't visible yet, it charts a **shared map** of **decision tickets** on the issue tracker and resolves them one at a time, producing **decisions, not deliverables**, until the fog is pushed back and the way is clear. Where **`/grill-with-docs`** sharpens an idea you can hold in one session, wayfinder is for the idea you can't, and it's slower and denser, so save it for exactly that, never a well-scoped feature.
46
+
47
+ When the map clears, **it hands off, it doesn't build**: merge onto the main flow at **`/to-spec`**, which collapses the map's linked decisions into a buildable plan, then `/to-tickets` and `/implement` as usual. Looping the map straight into `/implement` skips that collapse and throws the linked detail away, so go straight to `/implement` only when the effort turned out genuinely small.
48
+
49
+ ## Codebase health
50
+
51
+ Not feature work, just upkeep.
52
+
53
+ - **`/improve-codebase-architecture`** runs whenever you have a spare moment to keep the codebase good for agents to operate in. It surfaces **deepening opportunities**; picking one _generates an idea_ you can take into the main flow at `/grill-with-docs`. It's the survey that finds the candidates; **`/codebase-design`** (below) is the bench you design the chosen one on.
54
+
55
+ ## Vocabulary underneath
56
+
57
+ Two model-invoked references that run *beneath* the other skills, each the single source of truth for its vocabulary. Reach for them directly when the **words**, not the process, are the problem; or let the skills above pull them in.
58
+
59
+ - **`/domain-modeling`**: sharpen the project's *domain* language: challenge a fuzzy term, resolve an overloaded word ("account" doing three jobs), record a hard-to-reverse decision as an ADR. It's the active discipline `/grill-with-docs` drives to keep `CONTEXT.md` a clean glossary.
60
+ - **`/codebase-design`** is the deep-module vocabulary (module, interface, depth, seam, adapter, leverage, locality) for designing a module's *shape*: a lot of behaviour behind a small interface at a clean seam. `/tdd` and `/improve-codebase-architecture` both speak it.
61
+
62
+ ## Phase boundaries
63
+
64
+ A **phase** is a chunk of work inside a session: the grilling, the implementation, the QA. At the **boundary** between two of them you have five options, and picking between them is the fuzziest decision in this whole map:
65
+
66
+ - **Continue**: stay put. Costs nothing, loses nothing.
67
+ - **`/clear`**: empty the window, when nothing here matters to what's next.
68
+ - **`/handoff`** writes a portable markdown file. Narrow: only for a **new harness**, a **new directory**, a **colleague**, or forking a side task **mid-phase**. What it buys is portability.
69
+ - **Subagent**: send a tightly-scoped task to its own window and get a report back.
70
+ - **`/compact`** compresses this context and seeds a fresh session with it. The **default**, at the bottom of the tree rather than the first reach.
71
+
72
+ Read [PHASE-BOUNDARIES.md](PHASE-BOUNDARIES.md) for the ordered tree: the five questions, the reasoning behind each branch, and why the primary-source cost makes **Continue** the one to rule out first. Make the decision **at** a boundary; mid-phase, continue or split the rest into subagents.
73
+
74
+ ## Standalone
75
+
76
+ Off the main flow entirely.
77
+
78
+ - **`/grill-me`**: the same relentless interview as `/grill-with-docs`, but **stateless**: it saves nothing locally and builds no `CONTEXT.md`. Reach for it when you are **not working in a working directory** (sharpening a plan, a design, a piece of writing, anything with no repo under it). If you are in a working directory, use `/grill-with-docs` instead: it runs the same interview and leaves a paper trail, so it is strictly the better one.
79
+ - **`/grilling`** is the interview primitive itself: rounds, the frontier, facts are the agent's job and decisions are yours. `/grill-me` and `/grill-with-docs` are the two named ways in, and `/triage`, `/wayfinder` and `/improve-codebase-architecture` all run it internally. Reach for it directly only when you want the interview with no wrapper around it.
80
+ - **`/resolving-merge-conflicts`** works an in-progress merge or rebase conflict hunk by hunk, resolving by **intent** traced to each side's primary source rather than by picking lines, then finishes the operation. It never runs `--abort`. Standalone and off every flow: reach for it when you are already mid-conflict.
81
+ - **`/prototype`** is a small, throwaway program that answers one design question: does this state model feel right, or what should this UI look like. Throwaway is a constraint on how the code is written, not a promise to destroy it: the answer folds into the real code, and the prototype itself is kept as a **primary source** on a `prototype/<name>` branch out of main, pointed at from the implementation issue. It's the detour in step 2 of the main flow, but reach for it any time a design question is hard to settle on paper.
82
+ - **`/research`**: delegate reading legwork to a **background agent**: it investigates a question against **primary sources**, then leaves a cited Markdown file in the repo. Keep working while it reads. The file it produces is something to take *into* the main flow at `/grill-with-docs`, since research feeds the thinking rather than replacing it.
83
+ - **`/to-questionnaire`** comes in when the thing blocking you isn't in your head or the codebase but in **someone else's**, and it writes them a questionnaire to fill in. It's the inverse of `/grill-me`: instead of interviewing you about the subject, it interviews you about the **send** (who it's going to, what you need back) and aims the questions at the gap. What comes back is material for `/grill-with-docs` or `/to-spec`.
84
+ - **`/wizard`** is for the steps only a **human** can take: provisioning infrastructure, setting up credentials or CI secrets, clicking through an unfamiliar third-party dashboard, running a one-off migration or cutover. It generates an interactive bash script that opens each URL, captures each value, and writes it into `.env` and GitHub secrets, so the procedure stops being something you re-explain to an agent every time. Model-invoked, so the agent reaches for it the moment it hits a wall only you can pass. If the agent could just do it itself, it should; this is for where a human is genuinely in the loop.
85
+ - **`/wait-what`** is the corrective for a message that didn't land. Use it mid-conversation, inside any other skill, and the agent re-pitches what it just said with the context you were missing, in plain English, using the `CONTEXT.md` vocabulary. It works after the fact; `/grill-with-docs` is the upfront cure, because a shared language agreed early is what stops the jargon arriving at all.
86
+ - **`/teach`**: learn a concept over multiple sessions, using the current directory as a stateful workspace.
87
+ - **`/writing-for-agents`** is the reference for writing documents agents consume: skills, AGENTS.md, pointed-at docs.
88
+
89
+ ## Precondition
90
+
91
+ **`/setup-matt-pocock-skills`**: run before your first engineering flow to configure the issue tracker, triage labels, and doc layout the other skills assume. Custom issue trackers also work.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Ask Matt"
3
+ short_description: "Find the right skill or workflow"
4
+ policy:
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Pocock
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.