@agentshouse/kit 0.2.1-c903d1429e34a → 0.2.1-c9a26041e119a
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/README.md +16 -15
- package/dist/agents.js +58 -4
- package/dist/api.js +5 -1
- package/dist/bootstrap.json +4 -4
- package/dist/chatgpt.js +26 -0
- package/dist/clis.js +42 -9
- package/dist/conversations.js +6 -5
- package/dist/copies.js +18 -8
- package/dist/end.js +4 -0
- package/dist/files.js +7 -1
- package/dist/git.js +11 -8
- package/dist/home.js +41 -4
- package/dist/house-main.js +165 -65
- package/dist/instructions.js +4 -29
- package/dist/kit-main.js +53 -8
- package/dist/login.js +39 -13
- package/dist/parts.js +34 -16
- package/dist/placement.js +48 -0
- package/dist/relay.js +1 -1
- package/dist/resident.js +8 -4
- package/dist/skills.js +81 -12
- package/dist/stream.js +62 -13
- package/dist/transcription.js +3 -3
- package/dist/update.js +28 -6
- package/dist/wire.js +6 -0
- package/how-we-work.md +13 -3
- package/package.json +2 -1
- package/skills/ask-matt/SKILL.md +17 -11
- package/skills/ask-matt/agents/openai.yaml +1 -0
- package/skills/code-review/SKILL.md +5 -5
- package/skills/codebase-design/DESIGN-IT-TWICE.md +1 -1
- package/skills/codebase-design/SKILL.md +0 -2
- package/skills/diagnosing-bugs/SKILL.md +2 -4
- package/skills/domain-modeling/{CONTEXT-FORMAT.md → GLOSSARY-FORMAT.md} +10 -10
- package/skills/domain-modeling/SKILL.md +12 -14
- package/skills/grill-me/SKILL.md +1 -2
- package/skills/grill-me/agents/openai.yaml +1 -0
- package/skills/grill-with-docs/SKILL.md +1 -2
- package/skills/grill-with-docs/agents/openai.yaml +1 -0
- package/skills/grilling/SKILL.md +2 -2
- package/skills/handoff/SKILL.md +2 -3
- package/skills/handoff/agents/openai.yaml +1 -0
- package/skills/implement/SKILL.md +5 -4
- package/skills/implement/agents/openai.yaml +1 -0
- package/skills/implement-spec/SKILL.md +40 -0
- package/skills/implement-spec/agents/openai.yaml +5 -0
- package/skills/improve-codebase-architecture/SKILL.md +6 -7
- package/skills/improve-codebase-architecture/agents/openai.yaml +1 -0
- package/skills/pr/CREDITS.md +3 -0
- package/skills/pr/LICENSE +21 -0
- package/skills/pr/SKILL.md +170 -0
- package/skills/pr/agents/openai.yaml +3 -0
- package/skills/prototype/SKILL.md +0 -2
- package/skills/research/SKILL.md +0 -2
- package/skills/retro/LICENSE +21 -0
- package/skills/retro/SKILL.md +44 -0
- package/skills/retro/agents/openai.yaml +5 -0
- package/skills/tdd/SKILL.md +2 -4
- package/skills/teach/SKILL.md +3 -4
- package/skills/teach/agents/openai.yaml +1 -0
- package/skills/to-questionnaire/SKILL.md +1 -2
- package/skills/to-questionnaire/agents/openai.yaml +1 -0
- package/skills/to-spec/SKILL.md +1 -2
- package/skills/to-spec/agents/openai.yaml +1 -0
- package/skills/to-tickets/SKILL.md +3 -4
- package/skills/to-tickets/agents/openai.yaml +1 -0
- package/skills/triage/AGENT-BRIEF.md +207 -0
- package/skills/triage/LICENSE +21 -0
- package/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/skills/triage/SKILL.md +112 -0
- package/skills/triage/agents/openai.yaml +5 -0
- package/skills/wait-what/SKILL.md +2 -3
- package/skills/wait-what/agents/openai.yaml +1 -0
- package/skills/wayfinder/SKILL.md +5 -6
- package/skills/wayfinder/agents/openai.yaml +1 -0
- package/skills/wizard/LICENSE +21 -0
- package/skills/wizard/SKILL.md +44 -0
- package/skills/wizard/agents/openai.yaml +3 -0
- package/skills/wizard/template.sh +223 -0
- package/skills/writing-for-agents/SKILL.md +0 -2
- package/skills/resolving-merge-conflicts/SKILL.md +0 -16
- package/skills/resolving-merge-conflicts/agents/openai.yaml +0 -3
- /package/skills/{resolving-merge-conflicts → implement-spec}/LICENSE +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wayfinder
|
|
3
3
|
description: Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
<!-- Vendored from mattpocock/skills at commit c55ee46073ed923f86ce59a5eb3b6d895095d1b7 (skills/engineering/wayfinder). MIT licensed — see LICENSE in this directory. -->
|
|
7
|
-
|
|
8
7
|
A loose idea has arrived, too big for one agent session, and wrapped in fog: the way from here to the **destination** isn't visible yet. Wayfinding is about finding that way, not charging at the destination. This skill charts the way as a **shared map** on the repo's issue tracker, then works its **decision tickets** (questions whose resolution is a decision, not slices of a build to execute) one at a time until the route is clear.
|
|
9
8
|
|
|
10
9
|
The destination varies per effort, and naming it is the first act of charting: it shapes every ticket. It might be a spec to hand off and iterate on, a decision to lock before planning starts, or a change made in place like a data-structure migration. The map is domain-agnostic: engineering work, course content, whatever fits the shape.
|
|
@@ -63,7 +62,7 @@ Each ticket is a **child issue** of the map; the tracker's issue id is its ident
|
|
|
63
62
|
<the decision or investigation this ticket resolves>
|
|
64
63
|
```
|
|
65
64
|
|
|
66
|
-
Each ticket carries a `wayfinder:<type>` label, one of `research`, `prototype`, `grilling`, `task` (see [Ticket Types](#ticket-types)).
|
|
65
|
+
Each ticket carries a `wayfinder:<type>` label, one of `research`, `prototype`, `grilling`, `task` (see [Ticket Types](#ticket-types)). `wayfinder:` labels are the only labels a map and its tickets carry, never a triage label like `ready-for-agent`: they are decisions, not implementation work.
|
|
67
66
|
|
|
68
67
|
A session **claims** a ticket by assigning it to the dev driving the map, **first**, before any work, so concurrent sessions skip it. That assignee _is_ the claim: an open, unassigned ticket is unclaimed.
|
|
69
68
|
|
|
@@ -112,8 +111,8 @@ User invokes with a loose idea.
|
|
|
112
111
|
1. **Name the destination.** Call the Skill tool twice, for "grilling" and "domain-modeling", to pin down what this map is finding its way to: the spec, decision, or change. The destination fixes the scope, so it's settled first.
|
|
113
112
|
2. **Map the frontier.** Grill again, **breadth-first** this time: fan out across the whole space rather than deep on any one thread, surfacing the open decisions and the first steps takeable now. **If this surfaces no fog** (the way to the destination is already clear, the whole journey small enough for one session), you don't need a map. Stop and ask the user how they'd like to proceed.
|
|
114
113
|
3. **Create the map** (label `wayfinder:map`): Destination and Notes filled in, Decisions-so-far empty, the fog sketched into **Not yet specified**.
|
|
115
|
-
4. **Create the tickets you can specify now** as child issues of the map, then wire blocking edges in a **second pass** (issues need ids before they can reference each other). Wiring sorts them into the frontier and the blocked; everything you can't yet specify stays in the fog: the **Not yet specified** section.
|
|
116
|
-
5. **Fire the research subagents.** For each `research` ticket you just created, spin up a subagent that calls the Skill tool with "research" to resolve it in parallel, capturing its findings on a throwaway `research/<name>` branch with a context pointer from the ticket.
|
|
114
|
+
4. **Create the tickets you can specify now** as child issues of the map, then wire blocking edges in a **second pass** (issues need ids before they can reference each other). Write cross-references in that pass too, with real ids: a placeholder `#<n>` auto-links to an unrelated issue. Wiring sorts them into the frontier and the blocked; everything you can't yet specify stays in the fog: the **Not yet specified** section.
|
|
115
|
+
5. **Fire the research subagents.** For each `research` ticket you just created, spin up a subagent that calls the Skill tool with "research" to resolve it in parallel, capturing its findings on a throwaway `research/<name>` branch with a context pointer from the ticket. Push the branch but open no PR: it is never merged.
|
|
117
116
|
6. Stop: charting is one session's work; it hand-resolves nothing.
|
|
118
117
|
|
|
119
118
|
### Work through the map
|
|
@@ -122,7 +121,7 @@ User invokes with a map (URL or number). A ticket is **optional**: without one,
|
|
|
122
121
|
|
|
123
122
|
1. Load the **map**: the low-res view, not every ticket body.
|
|
124
123
|
2. Choose the ticket. If the user named one, use it. Otherwise take the first frontier ticket in order. **Claim it**: assign it to yourself before any work.
|
|
125
|
-
3. Resolve it. **Zoom as needed**: fetch the full body of any related or closed ticket on demand; call the Skill tool for whichever skills the `## Notes` block names. If in doubt, call the Skill tool twice, for "grilling" and "domain-modeling".
|
|
124
|
+
3. Resolve it as the type its `wayfinder:<type>` label names (see [Ticket Types](#ticket-types)). Read the label, not just the body: the body never states the type. **Zoom as needed**: fetch the full body of any related or closed ticket on demand; call the Skill tool for whichever skills the `## Notes` block names. If in doubt, call the Skill tool twice, for "grilling" and "domain-modeling".
|
|
126
125
|
4. Record the resolution: post the answer as a **resolution comment**, **close** the issue, and **append a context pointer** to the map's Decisions-so-far.
|
|
127
126
|
5. Add newly-surfaced tickets (create-then-wire); graduate any fog the answer has made specifiable, clearing each graduated patch from **Not yet specified** so it lives only as its new ticket. If the answer reveals that a ticket (this one or another) sits beyond the destination, **rule it out of scope** rather than resolving it on the route. If the decision invalidates other parts of the map, update or delete those tickets.
|
|
128
127
|
|
|
@@ -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.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wizard
|
|
3
|
+
description: Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wizard
|
|
7
|
+
|
|
8
|
+
A **wizard** is a bash script that walks a human, step by step, through a manual procedure that's tedious to do by hand and tedious to re-explain to an AI every time. It opens each URL, says exactly what to click and copy, captures the values, writes them where they belong (`.env`, GitHub secrets), confirms at every stage, and shows how many stages are left. It might configure third-party services, run a one-off migration, or move the project from one state to another.
|
|
9
|
+
|
|
10
|
+
The delightful UX is already solved by [template.sh](template.sh): stage-by-stage progress, confirmation gates, cross-platform URL opening (including WSL), hidden secret entry, idempotent `.env` upserts, `gh secret`/`gh variable` writes, and a closing summary. **Your job is only to scope the procedure and author its stages.** The library above the `STAGES` marker is identical in every wizard; that consistency is the point: never hand-edit it.
|
|
11
|
+
|
|
12
|
+
A wizard is ephemeral by default: built for one run, saved to a scratch or `scripts/` path, deleted when the job's done. Commit it only when the user wants a repeatable setup path that should live in the repo.
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
### 1. Scope the procedure
|
|
17
|
+
|
|
18
|
+
Work out every manual step the human must take and every value that gets captured along the way. Read the repo first, don't ask cold:
|
|
19
|
+
|
|
20
|
+
- For setup: `.env`, `.env.example`, `.env.*`, `README`, `docker-compose*`, framework config, and `.github/workflows/*` (every `secrets.*` / `vars.*` reference is a value the wizard must produce).
|
|
21
|
+
- For a migration or transition: the current state, the target state, and the irreversible actions between them.
|
|
22
|
+
|
|
23
|
+
Then show the user the ordered list of stages and the values each produces, and confirm: they may add, drop, or reorder.
|
|
24
|
+
|
|
25
|
+
**Done when:** every stage is named in order, and for each captured value you know (a) where the human gets it, (b) where it's written (`.env`, a GitHub secret, both, or nowhere; some stages are pure actions), and (c) whether it's secret (hidden entry) or public.
|
|
26
|
+
|
|
27
|
+
### 2. Map each stage's journey
|
|
28
|
+
|
|
29
|
+
For each stage, write the precise path a human follows: which URL to open, what to do there, where a value is shown, which variable it fills: e.g. "Dashboard → Developers → API keys → Reveal test key → copy". Where you don't actually know the current UI or the exact command, say so and ask the user or check the docs: never invent steps that may not exist.
|
|
30
|
+
|
|
31
|
+
**Done when:** every stage traces to concrete instructions a stranger could follow.
|
|
32
|
+
|
|
33
|
+
### 3. Author the wizard
|
|
34
|
+
|
|
35
|
+
Copy `template.sh` to the target path. Replace the example stage with one `stage` per step, in dependency order. Use the library helpers: `stage`, `say`/`step`, `open_url`, `ask`/`ask_secret`, `write_env`, `set_secret`/`set_var`, `pause`/`confirm`. Set `TOTAL_STAGES` to the number of stages you wrote.
|
|
36
|
+
|
|
37
|
+
Hold the bar the template sets: open the URL before asking for its value, use `ask_secret` for anything secret, `write_env` every persisted value, `set_secret` only the values CI actually needs, and `confirm` before any irreversible action. Each `stage` clears the screen so only the current step is visible: keep a stage to one focused task so nothing the human needs scrolls away. Don't touch the library above the marker.
|
|
38
|
+
|
|
39
|
+
### 4. Verify and hand off
|
|
40
|
+
|
|
41
|
+
- `bash -n <script>`; run `shellcheck` if available.
|
|
42
|
+
- `chmod +x <script>`.
|
|
43
|
+
- Don't run it end-to-end yourself: it opens browsers and blocks on human input. Trace it statically instead: every value from step 1 is captured and lands where step 1 said, and every `set_secret` name exactly matches a `secrets.*` reference in CI.
|
|
44
|
+
- Tell the user how to run it. If it's a repeatable setup path, commit it and link it from the README so the next person runs the script instead of asking an AI.
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# A wizard walks a human through a manual procedure, step by step.
|
|
4
|
+
# Generated by the /wizard skill.
|
|
5
|
+
#
|
|
6
|
+
# Everything above the "STAGES" marker is the wizard library: do not hand-edit
|
|
7
|
+
# it. Author the per-step stages below the marker.
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
# ──────────────────────────────────────────────────────────────────────────
|
|
12
|
+
# Wizard library: delightful, consistent UX, identical across every wizard.
|
|
13
|
+
# ──────────────────────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
if [[ -t 1 ]] && command -v tput >/dev/null 2>&1 && [[ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]]; then
|
|
16
|
+
BOLD=$(tput bold); DIM=$(tput dim); RESET=$(tput sgr0)
|
|
17
|
+
BLUE=$(tput setaf 4); GREEN=$(tput setaf 2); YELLOW=$(tput setaf 3)
|
|
18
|
+
else
|
|
19
|
+
BOLD=""; DIM=""; RESET=""; BLUE=""; GREEN=""; YELLOW=""
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Author sets this at the top of the stages section.
|
|
23
|
+
TOTAL_STAGES=0
|
|
24
|
+
|
|
25
|
+
_STAGE_INDEX=0
|
|
26
|
+
ENV_FILE="${ENV_FILE:-.env}"
|
|
27
|
+
WRITTEN_ENV=() # KEYs written to ENV_FILE this run
|
|
28
|
+
WRITTEN_SECRET=() # secret NAMEs set this run
|
|
29
|
+
SKIPPED=() # things we couldn't do (e.g. gh missing)
|
|
30
|
+
|
|
31
|
+
# _clear wipes the terminal so only the current step is on screen. No-op when
|
|
32
|
+
# output isn't a terminal, so piped logs stay readable.
|
|
33
|
+
_clear() {
|
|
34
|
+
[[ -t 1 ]] || return 0
|
|
35
|
+
if command -v tput >/dev/null 2>&1 && tput clear 2>/dev/null; then return 0; fi
|
|
36
|
+
printf '\033[2J\033[3J\033[H'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# banner "Title" shows the opening frame: what this wizard does.
|
|
40
|
+
banner() {
|
|
41
|
+
_clear
|
|
42
|
+
printf '\n%s%s %s%s\n' "$BOLD" "$BLUE" "$1" "$RESET"
|
|
43
|
+
printf '%s %s stages%s\n\n' "$DIM" "$TOTAL_STAGES" "$RESET"
|
|
44
|
+
printf '%s You drive the browser; this wizard tells you exactly what to do and\n' "$DIM"
|
|
45
|
+
printf ' captures the values you copy back. Stop any time with Ctrl-C and re-run\n'
|
|
46
|
+
printf ' later, since it remembers values already saved.%s\n' "$RESET"
|
|
47
|
+
pause "Ready to start?"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# stage "Name" clears the screen, then announces a stage and shows progress.
|
|
51
|
+
# Clearing keeps only the current step on screen.
|
|
52
|
+
stage() {
|
|
53
|
+
_clear
|
|
54
|
+
_STAGE_INDEX=$((_STAGE_INDEX + 1))
|
|
55
|
+
printf '\n%s%s▸ Stage %s/%s · %s%s\n' \
|
|
56
|
+
"$BOLD" "$BLUE" "$_STAGE_INDEX" "$TOTAL_STAGES" "$1" "$RESET"
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
# say "..." prints a plain instruction line.
|
|
60
|
+
say() { printf ' %s\n' "$1"; }
|
|
61
|
+
# step "..." is a numbered-feeling action the human takes in the browser.
|
|
62
|
+
step() { printf ' %s•%s %s\n' "$BLUE" "$RESET" "$1"; }
|
|
63
|
+
note() { printf ' %s%s%s\n' "$DIM" "$1" "$RESET"; }
|
|
64
|
+
warn() { printf ' %s⚠ %s%s\n' "$YELLOW" "$1" "$RESET"; }
|
|
65
|
+
|
|
66
|
+
# open_url URL opens it in the human's browser, cross-platform incl. WSL.
|
|
67
|
+
open_url() {
|
|
68
|
+
local url="$1"
|
|
69
|
+
printf ' %s↗ opening%s %s\n' "$GREEN" "$RESET" "$url"
|
|
70
|
+
{ if command -v wslview >/dev/null 2>&1; then wslview "$url"
|
|
71
|
+
elif command -v explorer.exe >/dev/null 2>&1; then explorer.exe "$url"
|
|
72
|
+
elif command -v xdg-open >/dev/null 2>&1; then xdg-open "$url"
|
|
73
|
+
elif command -v open >/dev/null 2>&1; then open "$url"
|
|
74
|
+
else false; fi
|
|
75
|
+
} >/dev/null 2>&1 || warn "couldn't open a browser, so visit it manually: $url"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
# pause "msg" waits for the human to confirm they've done the manual part.
|
|
79
|
+
pause() {
|
|
80
|
+
printf ' %s%s%s ' "$DIM" "${1:-Press Enter to continue}" "$RESET"
|
|
81
|
+
read -r _ || true
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# confirm "question" is a y/N gate; returns success on yes.
|
|
85
|
+
confirm() {
|
|
86
|
+
local reply=""
|
|
87
|
+
printf ' %s? %s [y/N] ' "$YELLOW" "$1"
|
|
88
|
+
read -r reply || true
|
|
89
|
+
[[ "$reply" =~ ^[Yy] ]]
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# _existing KEY: current value of KEY in ENV_FILE, if any, with write_env's single
|
|
93
|
+
# quotes or a plain dotenv double-quoted value undone.
|
|
94
|
+
_existing() {
|
|
95
|
+
[[ -f "$ENV_FILE" ]] || return 1
|
|
96
|
+
local line value sq="'\\''"; line=$(grep -E "^${1}=" "$ENV_FILE" | tail -n1) || return 1
|
|
97
|
+
value="${line#*=}"
|
|
98
|
+
if [[ "$value" == \'*\' ]]; then value="${value:1:${#value}-2}"; value="${value//"$sq"/\'}"
|
|
99
|
+
elif [[ "$value" == \"*\" ]]; then
|
|
100
|
+
value="${value:1:${#value}-2}"
|
|
101
|
+
[[ "$value" == *[\\\$\"]* ]] && return 1 # escapes, $ or ": can't decode safely; ask again
|
|
102
|
+
fi
|
|
103
|
+
printf '%s' "$value"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# ask KEY "Prompt" reads a value into $KEY. Offers the existing .env value as
|
|
107
|
+
# a default on re-runs (Enter keeps it). Visible input (non-secret), edited
|
|
108
|
+
# with Readline. Fails at EOF with no input.
|
|
109
|
+
ask() {
|
|
110
|
+
local key="$1" prompt="$2" current input s=$'\001' e=$'\002' p rc=0
|
|
111
|
+
current=$(_existing "$key" || true)
|
|
112
|
+
# Readline needs the colour codes wrapped in \001..\002 to place the cursor.
|
|
113
|
+
p=" $s$BOLD$e$prompt$s$RESET$e "
|
|
114
|
+
[[ -n "$current" ]] && p+="$s$DIM$e[Enter keeps current]$s$RESET$e "
|
|
115
|
+
read -e -r -p "$p" input || rc=1
|
|
116
|
+
if (( rc )) && [[ -z "$input" ]]; then return 1; fi
|
|
117
|
+
[[ -z "$input" && -n "$current" ]] && input="$current"
|
|
118
|
+
printf -v "$key" '%s' "$input"
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# ask_secret KEY "Prompt" is like ask, but input is hidden.
|
|
122
|
+
ask_secret() {
|
|
123
|
+
local key="$1" prompt="$2" current input rc=0
|
|
124
|
+
current=$(_existing "$key" || true)
|
|
125
|
+
if [[ -n "$current" ]]; then
|
|
126
|
+
printf ' %s%s%s %s[Enter keeps current]%s ' "$BOLD" "$prompt" "$RESET" "$DIM" "$RESET"
|
|
127
|
+
else
|
|
128
|
+
printf ' %s%s%s ' "$BOLD" "$prompt" "$RESET"
|
|
129
|
+
fi
|
|
130
|
+
read -rs input || rc=1
|
|
131
|
+
printf '\n'
|
|
132
|
+
if (( rc )) && [[ -z "$input" ]]; then return 1; fi
|
|
133
|
+
[[ -z "$input" && -n "$current" ]] && input="$current"
|
|
134
|
+
printf -v "$key" '%s' "$input"
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
# write_env KEY VALUE upserts KEY='VALUE' into ENV_FILE (replaces any existing
|
|
138
|
+
# line) and sets $KEY. Idempotent. Creates ENV_FILE at mode 0600; writes through
|
|
139
|
+
# a symlink and keeps an existing file's mode.
|
|
140
|
+
write_env() {
|
|
141
|
+
local key="$1" value="$2" tmp sq="'\\''"
|
|
142
|
+
[[ -e "$ENV_FILE" ]] || (umask 077 && : > "$ENV_FILE")
|
|
143
|
+
tmp=$(mktemp)
|
|
144
|
+
grep -vE "^${key}=" "$ENV_FILE" > "$tmp" || true
|
|
145
|
+
printf "%s='%s'\n" "$key" "${value//\'/$sq}" >> "$tmp"
|
|
146
|
+
cat "$tmp" > "$ENV_FILE"
|
|
147
|
+
rm -f "$tmp"
|
|
148
|
+
printf -v "$key" '%s' "$value"
|
|
149
|
+
WRITTEN_ENV+=("$key")
|
|
150
|
+
printf ' %s✓ wrote%s %s → %s\n' "$GREEN" "$RESET" "$key" "$ENV_FILE"
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
# set_secret NAME VALUE sets a GitHub Actions repo secret via gh. Falls back
|
|
154
|
+
# to a warning (and records it) if gh is unavailable or unauthenticated.
|
|
155
|
+
set_secret() {
|
|
156
|
+
local name="$1" value="$2"
|
|
157
|
+
if command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1; then
|
|
158
|
+
if printf '%s' "$value" | gh secret set "$name" >/dev/null 2>&1; then
|
|
159
|
+
WRITTEN_SECRET+=("$name")
|
|
160
|
+
printf ' %s✓ set%s GitHub secret %s\n' "$GREEN" "$RESET" "$name"
|
|
161
|
+
return
|
|
162
|
+
fi
|
|
163
|
+
fi
|
|
164
|
+
SKIPPED+=("GitHub secret $name (set it manually: gh secret set $name)")
|
|
165
|
+
warn "skipped GitHub secret $name: gh not ready; set it later"
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
# set_var NAME VALUE sets a GitHub Actions repo variable (non-secret).
|
|
169
|
+
set_var() {
|
|
170
|
+
local name="$1" value="$2"
|
|
171
|
+
if command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1; then
|
|
172
|
+
if gh variable set "$name" --body "$value" >/dev/null 2>&1; then
|
|
173
|
+
printf ' %s✓ set%s GitHub variable %s\n' "$GREEN" "$RESET" "$name"
|
|
174
|
+
return
|
|
175
|
+
fi
|
|
176
|
+
fi
|
|
177
|
+
SKIPPED+=("GitHub variable $name")
|
|
178
|
+
warn "skipped GitHub variable $name, gh not ready; set it later"
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
# finish clears, then shows a closing summary of everything configured.
|
|
182
|
+
finish() {
|
|
183
|
+
_clear
|
|
184
|
+
printf '\n%s%s ✓ Setup complete%s\n' "$BOLD" "$GREEN" "$RESET"
|
|
185
|
+
(( ${#WRITTEN_ENV[@]} )) && note "wrote ${#WRITTEN_ENV[@]} value(s) to $ENV_FILE: ${WRITTEN_ENV[*]}"
|
|
186
|
+
(( ${#WRITTEN_SECRET[@]} )) && note "set ${#WRITTEN_SECRET[@]} GitHub secret(s): ${WRITTEN_SECRET[*]}"
|
|
187
|
+
if (( ${#SKIPPED[@]} )); then
|
|
188
|
+
printf '\n'; warn "still to do by hand:"
|
|
189
|
+
for s in "${SKIPPED[@]}"; do note " - $s"; done
|
|
190
|
+
fi
|
|
191
|
+
printf '\n'
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
# ──────────────────────────────────────────────────────────────────────────
|
|
195
|
+
# STAGES: author this section. One stage() per step the human takes.
|
|
196
|
+
# Replace the example below. Set TOTAL_STAGES to match the stages you write.
|
|
197
|
+
# Keep every stage inside run_wizard and the last line as is: bash then parses
|
|
198
|
+
# the whole file before the first prompt, so an edit mid-run can't break it.
|
|
199
|
+
# ──────────────────────────────────────────────────────────────────────────
|
|
200
|
+
|
|
201
|
+
run_wizard() {
|
|
202
|
+
|
|
203
|
+
TOTAL_STAGES=1
|
|
204
|
+
|
|
205
|
+
banner "Stripe setup"
|
|
206
|
+
|
|
207
|
+
# ── Example stage: replace with your real steps ───────────────────────────
|
|
208
|
+
stage "Stripe: API keys"
|
|
209
|
+
say "We'll grab your Stripe test keys and store them for local dev + CI."
|
|
210
|
+
open_url "https://dashboard.stripe.com/test/apikeys"
|
|
211
|
+
step "On the API keys page, copy the Publishable key (starts pk_test_)."
|
|
212
|
+
ask STRIPE_PUBLISHABLE_KEY "Paste the publishable key:"
|
|
213
|
+
step "Click 'Reveal test key' on the Secret key row, then copy it."
|
|
214
|
+
ask_secret STRIPE_SECRET_KEY "Paste the secret key:"
|
|
215
|
+
write_env STRIPE_PUBLISHABLE_KEY "$STRIPE_PUBLISHABLE_KEY"
|
|
216
|
+
write_env STRIPE_SECRET_KEY "$STRIPE_SECRET_KEY"
|
|
217
|
+
set_secret STRIPE_SECRET_KEY "$STRIPE_SECRET_KEY" # CI needs this one
|
|
218
|
+
# ──────────────────────────────────────────────────────────────────────────
|
|
219
|
+
|
|
220
|
+
finish
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
run_wizard "$@"; exit
|
|
@@ -3,8 +3,6 @@ name: writing-for-agents
|
|
|
3
3
|
description: Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- Vendored from mattpocock/skills at commit c55ee46073ed923f86ce59a5eb3b6d895095d1b7 (skills/productivity/writing-for-agents). MIT licensed — see LICENSE in this directory. -->
|
|
7
|
-
|
|
8
6
|
Reference for writing any document an agent consumes: a skill, an `AGENTS.md` / `CLAUDE.md`, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable, since the agent takes the same _process_ every run rather than producing the same output.
|
|
9
7
|
|
|
10
8
|
When the document you're writing is a skill, read [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: resolving-merge-conflicts
|
|
3
|
-
description: "Use when you need to resolve an in-progress git merge/rebase conflict."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- Vendored from mattpocock/skills at commit c55ee46073ed923f86ce59a5eb3b6d895095d1b7 (skills/engineering/resolving-merge-conflicts). MIT licensed — see LICENSE in this directory. -->
|
|
7
|
-
|
|
8
|
-
1. **See the current state** of the merge/rebase. Check git history, and the conflicting files.
|
|
9
|
-
|
|
10
|
-
2. **Find the primary sources** for each conflict. Understand deeply why each change was made, and what the original intent was. Read the commit messages, check the PRs, check original issues/tickets.
|
|
11
|
-
|
|
12
|
-
3. **Resolve each hunk.** Preserve both intents where possible. Where incompatible, pick the one matching the merge's stated goal and note the trade-off. Do **not** invent new behaviour. Always resolve; never `--abort`.
|
|
13
|
-
|
|
14
|
-
4. Discover the project's **automated checks** and run them, typically typecheck, then tests, then format. Fix anything the merge broke.
|
|
15
|
-
|
|
16
|
-
5. **Finish the merge/rebase.** Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased.
|
|
File without changes
|