@installagent/sdk 0.2.0 → 0.4.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/dist/agent-mirror.d.ts +69 -0
- package/dist/agent-mirror.js +275 -0
- package/dist/claude-hours.d.ts +134 -0
- package/dist/claude-hours.js +638 -0
- package/dist/client-drive.d.ts +3 -0
- package/dist/client-drive.js +2 -2
- package/dist/client-linear-create.d.ts +10 -0
- package/dist/client-linear-create.js +30 -3
- package/dist/env-fill.js +21 -4
- package/dist/env-registry.d.ts +4 -0
- package/dist/env-registry.js +54 -2
- package/dist/git.d.ts +31 -0
- package/dist/git.js +59 -0
- package/dist/google-service-account.d.ts +20 -0
- package/dist/google-service-account.js +49 -0
- package/dist/hours-estimate.d.ts +43 -0
- package/dist/hours-estimate.js +159 -0
- package/dist/hours-export-schedule.d.ts +35 -0
- package/dist/hours-export-schedule.js +188 -0
- package/dist/hours-ledger.d.ts +137 -0
- package/dist/hours-ledger.js +926 -0
- package/dist/index.d.ts +14 -3
- package/dist/index.js +14 -3
- package/dist/portal-admin.d.ts +68 -0
- package/dist/portal-admin.js +64 -1
- package/dist/sync-repos.d.ts +7 -0
- package/dist/sync-repos.js +10 -1
- package/dist/template-sync.d.ts +10 -9
- package/dist/template-sync.js +14 -9
- package/dist/triage-backfill.d.ts +37 -0
- package/dist/triage-backfill.js +211 -0
- package/dist/triage-enable.d.ts +90 -0
- package/dist/triage-enable.js +428 -0
- package/dist/triage-gates.d.ts +252 -0
- package/dist/triage-gates.js +951 -0
- package/dist/workspace-push.d.ts +39 -0
- package/dist/workspace-push.js +78 -0
- package/dist/workspace-status.d.ts +37 -0
- package/dist/workspace-status.js +114 -0
- package/package.json +1 -1
- package/templates/env.example +6 -2
- package/templates/workspace-root/.claude/settings.json +12 -1
- package/templates/workspace-root/skills/.github/workflows/pr-to-slack.yml +53 -28
- package/templates/workspace-root/skills/CLAUDE.md +6 -1
- package/templates/workspace-root/skills/README.md +17 -2
- package/templates/workspace-root/skills/ad-machine/SKILL.md +140 -0
- package/templates/workspace-root/skills/client-deliverables/SKILL.md +1 -1
- package/templates/workspace-root/skills/client-deliverables/references/package-layout.md +3 -2
- package/templates/workspace-root/skills/client-latest/SKILL.md +124 -82
- package/templates/workspace-root/skills/client-latest/catchup.command.md +5 -4
- package/templates/workspace-root/skills/email-triage-rollout/SKILL.md +90 -13
- package/templates/workspace-root/skills/engagement-spec/SKILL.md +51 -18
- package/templates/workspace-root/skills/engagement-spec/references/spec-templates.md +10 -4
- package/templates/workspace-root/skills/github-profile/SKILL.md +106 -0
- package/templates/workspace-root/skills/ia-cli/SKILL.md +30 -1
- package/templates/workspace-root/skills/init_repo/SKILL.md +188 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type FetchFn, type PushFn, type StatusFn } from "./git.js";
|
|
2
|
+
/**
|
|
3
|
+
* `ia push` — push every repo in the workspace that is clean and strictly
|
|
4
|
+
* ahead of its upstream. Never commits anything and never force-pushes.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately narrow: a repo only gets pushed here if its working tree has
|
|
7
|
+
* no uncommitted changes AND it has local commits not yet on origin AND it
|
|
8
|
+
* is not also behind (a genuine fast-forward push). Anything dirty,
|
|
9
|
+
* diverged, or without an upstream is left alone and reported — those need
|
|
10
|
+
* a human/agent to look at the diff and decide, which is exactly what
|
|
11
|
+
* `ia status` surfaces. This mirrors `ia sync`'s guardrail in the other
|
|
12
|
+
* direction: never do anything to a repo that isn't unambiguously safe.
|
|
13
|
+
*/
|
|
14
|
+
export interface WorkspacePushOptions {
|
|
15
|
+
/** installagent/ workspace root. Defaults to the current dir. */
|
|
16
|
+
dir?: string;
|
|
17
|
+
/** Skip the `git fetch` before checking state. Default false. */
|
|
18
|
+
offline?: boolean;
|
|
19
|
+
/** Injectable for tests; defaults to real `git fetch --all --prune`. */
|
|
20
|
+
fetch?: FetchFn;
|
|
21
|
+
/** Injectable for tests; defaults to real `git status --porcelain=v2 --branch`. */
|
|
22
|
+
status?: StatusFn;
|
|
23
|
+
/** Injectable for tests; defaults to real `git push`. */
|
|
24
|
+
push?: PushFn;
|
|
25
|
+
}
|
|
26
|
+
export type WorkspacePushRepoStatus = "pushed" | "skipped" | "absent" | "failed";
|
|
27
|
+
export interface WorkspacePushRepoResult {
|
|
28
|
+
/** Path relative to the workspace root, e.g. `clients/client-mpnrealty`. */
|
|
29
|
+
name: string;
|
|
30
|
+
status: WorkspacePushRepoStatus;
|
|
31
|
+
detail: string;
|
|
32
|
+
}
|
|
33
|
+
export interface WorkspacePushResult {
|
|
34
|
+
ok: boolean;
|
|
35
|
+
dir: string;
|
|
36
|
+
repos: WorkspacePushRepoResult[];
|
|
37
|
+
nextSteps: string[];
|
|
38
|
+
}
|
|
39
|
+
export declare function pushWorkspaceRepos(options?: WorkspacePushOptions): Promise<WorkspacePushResult>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { gitFetchAll, gitPush, gitStatus, } from "./git.js";
|
|
4
|
+
import { workspaceRepoNames } from "./sync-repos.js";
|
|
5
|
+
export async function pushWorkspaceRepos(options = {}) {
|
|
6
|
+
const dir = resolve(options.dir ?? ".");
|
|
7
|
+
const fetch = options.fetch ?? gitFetchAll;
|
|
8
|
+
const status = options.status ?? gitStatus;
|
|
9
|
+
const push = options.push ?? gitPush;
|
|
10
|
+
const offline = options.offline ?? false;
|
|
11
|
+
const targets = workspaceRepoNames(dir);
|
|
12
|
+
const repos = [];
|
|
13
|
+
for (const rel of targets) {
|
|
14
|
+
const path = join(dir, ...rel.split("/"));
|
|
15
|
+
if (!existsSync(join(path, ".git"))) {
|
|
16
|
+
repos.push({ name: rel, status: "absent", detail: "not cloned on this machine" });
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
if (!offline)
|
|
21
|
+
await fetch(path);
|
|
22
|
+
const info = await status(path);
|
|
23
|
+
if (info.dirty || info.untracked > 0) {
|
|
24
|
+
repos.push({
|
|
25
|
+
name: rel,
|
|
26
|
+
status: "skipped",
|
|
27
|
+
detail: "uncommitted changes — commit deliberately first (never auto-committed)",
|
|
28
|
+
});
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (!info.upstream) {
|
|
32
|
+
repos.push({ name: rel, status: "skipped", detail: "no tracking remote configured" });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (info.behind > 0) {
|
|
36
|
+
repos.push({
|
|
37
|
+
name: rel,
|
|
38
|
+
status: "skipped",
|
|
39
|
+
detail: `${info.ahead} ahead / ${info.behind} behind — diverged or needs \`ia sync\` first, not a safe fast-forward push`,
|
|
40
|
+
});
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (info.ahead === 0) {
|
|
44
|
+
repos.push({ name: rel, status: "skipped", detail: "nothing to push" });
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
await push(path);
|
|
48
|
+
repos.push({
|
|
49
|
+
name: rel,
|
|
50
|
+
status: "pushed",
|
|
51
|
+
detail: `pushed ${info.ahead} commit(s)`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
repos.push({
|
|
56
|
+
name: rel,
|
|
57
|
+
status: "failed",
|
|
58
|
+
detail: String(error instanceof Error ? error.message : error),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const failed = repos.filter((repo) => repo.status === "failed");
|
|
63
|
+
const skippedDirty = repos.filter((repo) => repo.status === "skipped" && repo.detail.startsWith("uncommitted"));
|
|
64
|
+
const nextSteps = [];
|
|
65
|
+
if (failed.length > 0) {
|
|
66
|
+
nextSteps.push(`${failed.length} repo(s) failed to push — see detail per repo (${failed
|
|
67
|
+
.map((repo) => repo.name)
|
|
68
|
+
.join(", ")})`);
|
|
69
|
+
}
|
|
70
|
+
if (skippedDirty.length > 0) {
|
|
71
|
+
nextSteps.push(`${skippedDirty.length} repo(s) have uncommitted changes to review and commit before ` +
|
|
72
|
+
`they can be pushed (${skippedDirty.map((repo) => repo.name).join(", ")}) — run \`ia status\` for the full picture`);
|
|
73
|
+
}
|
|
74
|
+
if (nextSteps.length === 0) {
|
|
75
|
+
nextSteps.push("nothing left to push");
|
|
76
|
+
}
|
|
77
|
+
return { ok: failed.length === 0, dir, repos, nextSteps };
|
|
78
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type FetchFn, type RepoStatusInfo, type StatusFn } from "./git.js";
|
|
2
|
+
/**
|
|
3
|
+
* `ia status` — report git state across every repo in the workspace (team
|
|
4
|
+
* repos + every `clients/client-*` clone present on this machine) without
|
|
5
|
+
* touching anything but the remote-tracking refs.
|
|
6
|
+
*
|
|
7
|
+
* Read-only: fetches (never pulls, never merges), then reads
|
|
8
|
+
* `git status`. A repo never changes as a result of this command — it only
|
|
9
|
+
* tells you which repos need a human/agent decision (commit the dirty ones,
|
|
10
|
+
* run `ia push` for the clean-but-ahead ones, run `ia sync` for the
|
|
11
|
+
* behind ones).
|
|
12
|
+
*/
|
|
13
|
+
export interface WorkspaceStatusOptions {
|
|
14
|
+
/** installagent/ workspace root. Defaults to the current dir. */
|
|
15
|
+
dir?: string;
|
|
16
|
+
/** Skip the `git fetch` and read local refs as last fetched. Default false. */
|
|
17
|
+
offline?: boolean;
|
|
18
|
+
/** Injectable for tests; defaults to real `git fetch --all --prune`. */
|
|
19
|
+
fetch?: FetchFn;
|
|
20
|
+
/** Injectable for tests; defaults to real `git status --porcelain=v2 --branch`. */
|
|
21
|
+
status?: StatusFn;
|
|
22
|
+
}
|
|
23
|
+
export type WorkspaceRepoState = "clean" | "dirty" | "ahead" | "behind" | "diverged" | "absent" | "no-upstream" | "failed";
|
|
24
|
+
export interface WorkspaceRepoStatus {
|
|
25
|
+
/** Path relative to the workspace root, e.g. `clients/client-mpnrealty`. */
|
|
26
|
+
name: string;
|
|
27
|
+
state: WorkspaceRepoState;
|
|
28
|
+
detail: string;
|
|
29
|
+
info?: RepoStatusInfo;
|
|
30
|
+
}
|
|
31
|
+
export interface WorkspaceStatusResult {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
dir: string;
|
|
34
|
+
repos: WorkspaceRepoStatus[];
|
|
35
|
+
nextSteps: string[];
|
|
36
|
+
}
|
|
37
|
+
export declare function workspaceStatus(options?: WorkspaceStatusOptions): Promise<WorkspaceStatusResult>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { gitFetchAll, gitStatus } from "./git.js";
|
|
4
|
+
import { workspaceRepoNames } from "./sync-repos.js";
|
|
5
|
+
export async function workspaceStatus(options = {}) {
|
|
6
|
+
const dir = resolve(options.dir ?? ".");
|
|
7
|
+
const fetch = options.fetch ?? gitFetchAll;
|
|
8
|
+
const status = options.status ?? gitStatus;
|
|
9
|
+
const offline = options.offline ?? false;
|
|
10
|
+
const targets = workspaceRepoNames(dir);
|
|
11
|
+
const repos = [];
|
|
12
|
+
for (const rel of targets) {
|
|
13
|
+
const path = join(dir, ...rel.split("/"));
|
|
14
|
+
if (!existsSync(join(path, ".git"))) {
|
|
15
|
+
repos.push({
|
|
16
|
+
name: rel,
|
|
17
|
+
state: "absent",
|
|
18
|
+
detail: "not cloned on this machine",
|
|
19
|
+
});
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
if (!offline)
|
|
24
|
+
await fetch(path);
|
|
25
|
+
const info = await status(path);
|
|
26
|
+
if (info.dirty || info.untracked > 0) {
|
|
27
|
+
repos.push({
|
|
28
|
+
name: rel,
|
|
29
|
+
state: "dirty",
|
|
30
|
+
detail: `${info.dirty ? "uncommitted changes" : ""}` +
|
|
31
|
+
`${info.dirty && info.untracked > 0 ? " + " : ""}` +
|
|
32
|
+
`${info.untracked > 0 ? `${info.untracked} untracked file(s)` : ""} — review before committing`,
|
|
33
|
+
info,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else if (!info.upstream) {
|
|
37
|
+
repos.push({
|
|
38
|
+
name: rel,
|
|
39
|
+
state: "no-upstream",
|
|
40
|
+
detail: "clean, but this branch has no tracking remote",
|
|
41
|
+
info,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else if (info.ahead > 0 && info.behind > 0) {
|
|
45
|
+
repos.push({
|
|
46
|
+
name: rel,
|
|
47
|
+
state: "diverged",
|
|
48
|
+
detail: `${info.ahead} ahead / ${info.behind} behind — needs manual resolution`,
|
|
49
|
+
info,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else if (info.ahead > 0) {
|
|
53
|
+
repos.push({
|
|
54
|
+
name: rel,
|
|
55
|
+
state: "ahead",
|
|
56
|
+
detail: `${info.ahead} commit(s) ready to push`,
|
|
57
|
+
info,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else if (info.behind > 0) {
|
|
61
|
+
repos.push({
|
|
62
|
+
name: rel,
|
|
63
|
+
state: "behind",
|
|
64
|
+
detail: `${info.behind} commit(s) behind — run \`ia sync\``,
|
|
65
|
+
info,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
repos.push({ name: rel, state: "clean", detail: "up to date", info });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
repos.push({
|
|
74
|
+
name: rel,
|
|
75
|
+
state: "failed",
|
|
76
|
+
detail: String(error instanceof Error ? error.message : error),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const dirtyRepos = repos.filter((r) => r.state === "dirty");
|
|
81
|
+
const aheadRepos = repos.filter((r) => r.state === "ahead");
|
|
82
|
+
const behindRepos = repos.filter((r) => r.state === "behind");
|
|
83
|
+
const divergedRepos = repos.filter((r) => r.state === "diverged");
|
|
84
|
+
const failedRepos = repos.filter((r) => r.state === "failed");
|
|
85
|
+
const nextSteps = [];
|
|
86
|
+
if (dirtyRepos.length > 0) {
|
|
87
|
+
nextSteps.push(`${dirtyRepos.length} repo(s) have uncommitted changes — review and commit each ` +
|
|
88
|
+
`deliberately (${dirtyRepos.map((r) => r.name).join(", ")}); this command never commits for you`);
|
|
89
|
+
}
|
|
90
|
+
if (aheadRepos.length > 0) {
|
|
91
|
+
nextSteps.push(`${aheadRepos.length} repo(s) have unpushed commits — run \`ia push\` to push them ` +
|
|
92
|
+
`(${aheadRepos.map((r) => r.name).join(", ")})`);
|
|
93
|
+
}
|
|
94
|
+
if (behindRepos.length > 0) {
|
|
95
|
+
nextSteps.push(`${behindRepos.length} repo(s) are behind origin — run \`ia sync\` to fast-forward ` +
|
|
96
|
+
`(${behindRepos.map((r) => r.name).join(", ")})`);
|
|
97
|
+
}
|
|
98
|
+
if (divergedRepos.length > 0) {
|
|
99
|
+
nextSteps.push(`${divergedRepos.length} repo(s) have diverged from origin and need manual resolution ` +
|
|
100
|
+
`(${divergedRepos.map((r) => r.name).join(", ")})`);
|
|
101
|
+
}
|
|
102
|
+
if (failedRepos.length > 0) {
|
|
103
|
+
nextSteps.push(`${failedRepos.length} repo(s) failed to check — see detail per repo ` +
|
|
104
|
+
`(${failedRepos.map((r) => r.name).join(", ")})`);
|
|
105
|
+
}
|
|
106
|
+
if (nextSteps.length === 0)
|
|
107
|
+
nextSteps.push("everything is clean and up to date");
|
|
108
|
+
return {
|
|
109
|
+
ok: failedRepos.length === 0 && divergedRepos.length === 0,
|
|
110
|
+
dir,
|
|
111
|
+
repos,
|
|
112
|
+
nextSteps,
|
|
113
|
+
};
|
|
114
|
+
}
|
package/package.json
CHANGED
package/templates/env.example
CHANGED
|
@@ -34,11 +34,15 @@ N8N_API_URL=
|
|
|
34
34
|
# n8n API base INCLUDING /api/v1, e.g. https://n8n.installagent.com/api/v1
|
|
35
35
|
N8N_API_KEY=
|
|
36
36
|
# n8n → Settings → API — filled by `ia env fill`
|
|
37
|
+
HOURS_EXPORT_SECRET=
|
|
38
|
+
# lets `ia hours-export` send your file to the ledger keeper — filled by `ia env fill`
|
|
37
39
|
GEMINI_API_KEY=
|
|
38
40
|
|
|
39
41
|
# ── shared infra (n8n workflows, team-infra scripts) ─────────────────────────
|
|
40
|
-
|
|
41
|
-
#
|
|
42
|
+
SLACK_RELAY_SECRET=
|
|
43
|
+
# Agent Zero relay secret (x-relay-secret header) — filled by `ia env fill`
|
|
44
|
+
N8N_OAUTH_CALLBACK_URL=
|
|
45
|
+
# n8n OAuth redirect URL (paste into a provider's OAuth app) — filled by `ia env fill`
|
|
42
46
|
# AIRTABLE_BASE_ID=
|
|
43
47
|
# AIRTABLE_CLIENTS_TABLE_ID=
|
|
44
48
|
# N8N_WEBHOOK_URL=
|
|
@@ -24,7 +24,18 @@
|
|
|
24
24
|
"Bash(find * -type f*)",
|
|
25
25
|
"Bash(pnpm test*)",
|
|
26
26
|
"Bash(pnpm check*)",
|
|
27
|
-
"Bash(pnpm type-check*)"
|
|
27
|
+
"Bash(pnpm type-check*)",
|
|
28
|
+
"Bash(pnpm --filter * test*)",
|
|
29
|
+
"Bash(pnpm vitest run *)",
|
|
30
|
+
"Bash(curl -s -o /dev/null -w *)",
|
|
31
|
+
"Bash(curl -s -w *)",
|
|
32
|
+
"Bash(set -a*)",
|
|
33
|
+
"Bash(set +a*)",
|
|
34
|
+
"Bash(export PATH=*google-cloud-sdk*)",
|
|
35
|
+
"mcp__claude-in-chrome__get_page_text",
|
|
36
|
+
"mcp__Claude_Browser__navigate",
|
|
37
|
+
"mcp__claude-in-chrome__navigate",
|
|
38
|
+
"mcp__claude-in-chrome__tabs_context_mcp"
|
|
28
39
|
],
|
|
29
40
|
"deny": [
|
|
30
41
|
"Read(.env)",
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
name: PR → Slack (approve / close)
|
|
2
2
|
|
|
3
|
-
# Posts every new PR to Slack with "Merge" and "Close"
|
|
4
|
-
# This workflow only POSTS (it is read-only). The button clicks are
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
3
|
+
# Posts every new PR to Slack (as @Agent Zero) with "Merge" and "Close"
|
|
4
|
+
# buttons. This workflow only POSTS (it is read-only). The button clicks are
|
|
5
|
+
# handled by @Agent Zero itself — team-tools/apps/slack-agent, Bolt Socket
|
|
6
|
+
# Mode, the `pr_merge`/`pr_close` action handlers in src/app.ts — which
|
|
7
|
+
# squash-merges (or closes) via the GitHub API using its own write-scoped
|
|
8
|
+
# token. Only an authorized Install Agent team member's click is honored
|
|
9
|
+
# (same permission check the bot uses everywhere else). The button's `value`
|
|
10
|
+
# carries the owner/repo + PR number as JSON, so this workflow stays
|
|
11
|
+
# repo-agnostic — no regex over the posted message, no per-repo config.
|
|
10
12
|
#
|
|
11
|
-
# Required
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
13
|
+
# Required secrets (both ORGANIZATION secrets, visibility "all repositories",
|
|
14
|
+
# set once so every current and future repo is covered with no per-repo
|
|
15
|
+
# setup — a repo-level secret of the same name also works and takes
|
|
16
|
+
# precedence):
|
|
17
|
+
# SLACK_PR_BOT_TOKEN — @Agent Zero's Slack bot token (xoxb-), needs the
|
|
18
|
+
# chat:write scope. Same token value as the
|
|
19
|
+
# slack-agent deploy's SLACK_BOT_TOKEN
|
|
20
|
+
# (team-infra/agent-hosting) — Agent Zero's Socket
|
|
21
|
+
# Mode connection is what receives the button
|
|
22
|
+
# clicks, so the posting identity and the
|
|
23
|
+
# interactivity receiver have to be the same app.
|
|
24
|
+
# SLACK_PR_CHANNEL_ID — the Slack channel ID (#notify-prs) to post into.
|
|
20
25
|
#
|
|
21
|
-
# If
|
|
22
|
-
# safe to land in a repo before the
|
|
26
|
+
# If either secret is absent the job logs a notice and exits green, so this
|
|
27
|
+
# file is safe to land in a repo before the secrets exist.
|
|
23
28
|
|
|
24
29
|
on:
|
|
25
30
|
pull_request:
|
|
@@ -38,8 +43,10 @@ jobs:
|
|
|
38
43
|
steps:
|
|
39
44
|
- name: Post PR to Slack with action buttons
|
|
40
45
|
env:
|
|
41
|
-
|
|
46
|
+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_PR_BOT_TOKEN }}
|
|
47
|
+
SLACK_CHANNEL_ID: ${{ secrets.SLACK_PR_CHANNEL_ID }}
|
|
42
48
|
PR_REPO: ${{ github.event.repository.name }}
|
|
49
|
+
PR_REPO_FULL: ${{ github.event.repository.full_name }}
|
|
43
50
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
44
51
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
45
52
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
@@ -51,14 +58,20 @@ jobs:
|
|
|
51
58
|
PR_CHANGED: ${{ github.event.pull_request.changed_files }}
|
|
52
59
|
run: |
|
|
53
60
|
set -euo pipefail
|
|
54
|
-
if [ -z "${
|
|
55
|
-
echo "::notice::
|
|
61
|
+
if [ -z "${SLACK_BOT_TOKEN:-}" ] || [ -z "${SLACK_CHANNEL_ID:-}" ]; then
|
|
62
|
+
echo "::notice::SLACK_PR_BOT_TOKEN / SLACK_PR_CHANNEL_ID not set (org or repo secret) — skipping the Slack post."
|
|
56
63
|
exit 0
|
|
57
64
|
fi
|
|
58
65
|
# Build the Block Kit payload with jq so PR titles/branches that
|
|
59
|
-
# contain quotes or other JSON-breaking characters are escaped
|
|
66
|
+
# contain quotes or other JSON-breaking characters are escaped
|
|
67
|
+
# safely. Each button's value is itself a JSON object
|
|
68
|
+
# ({"repo":"owner/repo","pr":N}) — Agent Zero parses that directly,
|
|
69
|
+
# so it never has to regex the rendered Slack message to figure out
|
|
70
|
+
# which PR a click was for.
|
|
60
71
|
payload=$(jq -n \
|
|
72
|
+
--arg channel "$SLACK_CHANNEL_ID" \
|
|
61
73
|
--arg repo "$PR_REPO" \
|
|
74
|
+
--arg repoFull "$PR_REPO_FULL" \
|
|
62
75
|
--arg num "$PR_NUMBER" \
|
|
63
76
|
--arg title "$PR_TITLE" \
|
|
64
77
|
--arg url "$PR_URL" \
|
|
@@ -67,6 +80,7 @@ jobs:
|
|
|
67
80
|
--arg head "$PR_HEAD" \
|
|
68
81
|
--arg stats "+$PR_ADDITIONS / -$PR_DELETIONS · $PR_CHANGED files" \
|
|
69
82
|
'{
|
|
83
|
+
channel: $channel,
|
|
70
84
|
text: ("New PR in " + $repo + " #" + $num + ": " + $title),
|
|
71
85
|
blocks: [
|
|
72
86
|
{ type: "header",
|
|
@@ -80,14 +94,16 @@ jobs:
|
|
|
80
94
|
block_id: ("pr_" + $num),
|
|
81
95
|
elements: [
|
|
82
96
|
{ type: "button", style: "primary", action_id: "pr_merge",
|
|
83
|
-
text: { type: "plain_text", text: "✅ Merge" },
|
|
97
|
+
text: { type: "plain_text", text: "✅ Merge" },
|
|
98
|
+
value: ({ repo: $repoFull, pr: ($num | tonumber) } | tojson),
|
|
84
99
|
confirm: {
|
|
85
100
|
title: { type: "plain_text", text: "Merge this PR?" },
|
|
86
101
|
text: { type: "mrkdwn", text: ("Squash-merge *" + $repo + "* PR #" + $num + " into `" + $base + "` and delete `" + $head + "`.") },
|
|
87
102
|
confirm: { type: "plain_text", text: "Merge" },
|
|
88
103
|
deny: { type: "plain_text", text: "Cancel" } } },
|
|
89
104
|
{ type: "button", style: "danger", action_id: "pr_close",
|
|
90
|
-
text: { type: "plain_text", text: "🗑️ Close" },
|
|
105
|
+
text: { type: "plain_text", text: "🗑️ Close" },
|
|
106
|
+
value: ({ repo: $repoFull, pr: ($num | tonumber) } | tojson),
|
|
91
107
|
confirm: {
|
|
92
108
|
title: { type: "plain_text", text: "Close this PR?" },
|
|
93
109
|
text: { type: "mrkdwn", text: ("Close *" + $repo + "* PR #" + $num + " without merging.") },
|
|
@@ -96,7 +112,16 @@ jobs:
|
|
|
96
112
|
] }
|
|
97
113
|
]
|
|
98
114
|
}')
|
|
99
|
-
#
|
|
100
|
-
#
|
|
101
|
-
|
|
102
|
-
|
|
115
|
+
# chat.postMessage returns HTTP 200 even on a logical failure (e.g.
|
|
116
|
+
# a channel Agent Zero isn't in), so the outcome is read from the
|
|
117
|
+
# response body's `ok` field, not the HTTP status.
|
|
118
|
+
response=$(curl -sS -X POST \
|
|
119
|
+
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
|
|
120
|
+
-H 'Content-type: application/json; charset=utf-8' \
|
|
121
|
+
--data "$payload" \
|
|
122
|
+
https://slack.com/api/chat.postMessage)
|
|
123
|
+
ok=$(echo "$response" | jq -r '.ok')
|
|
124
|
+
if [ "$ok" != "true" ]; then
|
|
125
|
+
echo "::error::Slack rejected the post: $response"
|
|
126
|
+
exit 1
|
|
127
|
+
fi
|
|
@@ -25,6 +25,7 @@ skills/
|
|
|
25
25
|
├── sso-gated-client-app/ # a client-facing internal app behind their Google Workspace SSO (Next.js + Vercel)
|
|
26
26
|
├── vendor-feed-ingestion/ # recurring vendor feeds (SFTP/email → S3 → n8n) + the guards that refuse a bad file
|
|
27
27
|
├── email-triage-rollout/ # AI inbox triage into a live mailbox: staged soak → label → organize → full + the gate per stage
|
|
28
|
+
├── ad-machine/ # Meta ads creative engine: brief or client asset library → ad batch for the banked paused-publish rail
|
|
28
29
|
├── backtest-acceptance-gates/ # prove an automation works before the client trusts it (ground truth, evidence, gates)
|
|
29
30
|
├── installagent-brand-kit/ # our brand for print/PDF/Excalidraw/decks (logo + brand red #d11a1a)
|
|
30
31
|
├── design-system/ # the Install Agent Design System (screens/UI)
|
|
@@ -33,7 +34,9 @@ skills/
|
|
|
33
34
|
├── linear/ # Linear issue workflow for client build work (status discipline, sub-issue trees, PR linking)
|
|
34
35
|
├── ia-cli/ # route internal ops through the `ia` CLI (team-tools) — decision map + guardrails
|
|
35
36
|
├── gcloud-cli-setup/ # one named gcloud configuration per account/client + check-before-you-run discipline
|
|
36
|
-
|
|
37
|
+
├── slack-voice/ # INTERNAL Slack: terse bullets, hard numbers, no adjectives (client Slack → house-voice)
|
|
38
|
+
├── github-profile/ # force gh CLI + git commits onto the noahm-ia account before any GitHub action
|
|
39
|
+
└── init_repo/ # explicit-only /init_repo — dev branch + default branch + one milestone/root-branch per leaf issue
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
Each is `skills/<name>/SKILL.md`, with bulky tables in `references/`.
|
|
@@ -63,6 +66,8 @@ Each is `skills/<name>/SKILL.md`, with bulky tables in `references/`.
|
|
|
63
66
|
| Working an `INS-xxx` issue / a client's Linear project | `linear` |
|
|
64
67
|
| Any task an `ia` command covers (client context, intake, agent bank, secrets, setup/doctor) | `ia-cli` |
|
|
65
68
|
| Setting up or switching gcloud CLI accounts/configurations | `gcloud-cli-setup` |
|
|
69
|
+
| Any `gh` command, git push/PR, or GitHub API call | `github-profile` |
|
|
70
|
+
| User explicitly runs `/init_repo` (dev branch + milestones + root branches on an existing client repo) | `init_repo` |
|
|
66
71
|
|
|
67
72
|
`design-system` is the **screen** layer (dark, signal-red, Hanken Grotesk); it
|
|
68
73
|
mirrors the code source of truth `team-web/packages/ui`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Install Agent skills
|
|
2
2
|
|
|
3
|
-
Twenty-
|
|
3
|
+
Twenty-five reusable, cross-repo how-tos that any coding agent in the workspace
|
|
4
4
|
loads when a task matches the skill's `description`. They encode the parts of
|
|
5
5
|
our delivery process that are easy to get wrong and expensive to rediscover —
|
|
6
6
|
the SOW clause we always forget, the Excalidraw JSON that has to be valid, the
|
|
@@ -17,7 +17,7 @@ workflows, and diagrams across more than one repo. Repo-local skills live in
|
|
|
17
17
|
## How these get loaded
|
|
18
18
|
|
|
19
19
|
Every skill is `<name>/SKILL.md` with YAML frontmatter (`name`, `description`).
|
|
20
|
-
|
|
20
|
+
23 of them are symlinked into [`../.claude/skills/`](../.claude/skills/), so Claude
|
|
21
21
|
Code and Cowork register them automatically — they appear in the skill menu and
|
|
22
22
|
fire on their own without being invoked by name. The `description` is the
|
|
23
23
|
trigger; the body is only read once the skill fires.
|
|
@@ -53,6 +53,7 @@ of each other, except that a Salesforce read usually feeds one of the other two.
|
|
|
53
53
|
|---|---|
|
|
54
54
|
| [`vendor-feed-ingestion`](./vendor-feed-ingestion/) | A recurring vendor file lands (SFTP/email → S3 → n8n), or one went wrong |
|
|
55
55
|
| [`email-triage-rollout`](./email-triage-rollout/) | An AI triage agent goes into a client's live mailbox — the staged soak → label → organize → full program and its gates |
|
|
56
|
+
| [`ad-machine`](./ad-machine/) | A client needs a Meta video-ad batch — script/brief or their existing asset library → approved creatives + `batch.json`, handed to the banked `meta-video-ads-agent` paused-publish rail |
|
|
56
57
|
| [`salesforce-api-snapshot`](./salesforce-api-snapshot/) | Reading a client's Salesforce or managed-package org (Lumary, Vlocity, nCino) |
|
|
57
58
|
| [`sso-gated-client-app`](./sso-gated-client-app/) | Building a screen the client's staff log into — dashboard, map, worklist |
|
|
58
59
|
| [`google-chat-app-setup`](./google-chat-app-setup/) | Deploying an n8n-backed Chat app across a client's Workspace domain |
|
|
@@ -75,6 +76,18 @@ context, intake, agent bank, secrets, `wizard`/`doctor`). Check it before
|
|
|
75
76
|
writing any custom script against GitHub, Airtable, Linear, Drive, n8n, or the
|
|
76
77
|
portal.
|
|
77
78
|
|
|
79
|
+
[`github-profile`](./github-profile/) — force gh CLI + git commits onto the
|
|
80
|
+
`noahm-ia` account before any GitHub action on this machine (two accounts are
|
|
81
|
+
logged in; only one is the work identity).
|
|
82
|
+
|
|
83
|
+
[`init_repo`](./init_repo/) — **explicit-invocation only**, never fires on
|
|
84
|
+
its own. Run `/init_repo` against an existing `client-<slug>` repo to create
|
|
85
|
+
a `dev` branch, set it as the GitHub default, and lay down one GitHub
|
|
86
|
+
milestone + one root branch per Linear main issue that will need a commit
|
|
87
|
+
(sub-issues fold into that milestone's checklist, never their own
|
|
88
|
+
milestone). Doesn't touch issue-level branches or GitHub issues — those
|
|
89
|
+
stay manual.
|
|
90
|
+
|
|
78
91
|
## How they compose
|
|
79
92
|
|
|
80
93
|
Arrows point from a skill to the ones it defers to. `client-deliverables` is
|
|
@@ -120,9 +133,11 @@ skills also ship a rendered PDF guide for handing to a technician.
|
|
|
120
133
|
| `email-triage-rollout` | 181 | — |
|
|
121
134
|
| `engagement-spec` | 272 | `references/spec-templates.md` |
|
|
122
135
|
| `gcloud-cli-setup` | 100 | — |
|
|
136
|
+
| `github-profile` | 56 | — |
|
|
123
137
|
| `google-chat-app-setup` | 136 | PDF guide |
|
|
124
138
|
| `house-voice` | 228 | `references/source-copy.md` |
|
|
125
139
|
| `ia-cli` | 87 | — |
|
|
140
|
+
| `init_repo` | 188 | — |
|
|
126
141
|
| `installagent-brand-kit` | 161 | 4 `references/`, 5 `scripts/` (brand, deck, deck_lint, logo_raster, make_deck_template), logo SVGs + deck template |
|
|
127
142
|
| `linear` | 186 | — |
|
|
128
143
|
| `salesforce-api-snapshot` | 379 | `references/` schema-discovery SOQL, snapshot storage · PDF guide |
|