@punks/cli 2.5.1 → 2.5.3

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 (37) hide show
  1. package/AGENTS.md +2 -2
  2. package/README.md +5 -5
  3. package/dist/BASELINE_CHANGELOG.md +39 -0
  4. package/dist/CHANGELOG.md +63 -0
  5. package/dist/data/hooks/format-edited-file.mjs +20 -0
  6. package/dist/index.js +255 -37
  7. package/dist/skills/agnostic/backend/backend-domain-structure/SKILL.md +18 -6
  8. package/dist/skills/agnostic/backend/backend-domain-structure/references/layout.md +61 -3
  9. package/dist/skills/agnostic/cli/{dp-cli → hi-cli}/SKILL.md +3 -3
  10. package/dist/skills/agnostic/cli/{dp-cli → hi-cli}/references/commands.md +1 -1
  11. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +2 -2
  12. package/dist/skills/frameworks/pulumi/package-usage/SKILL.md +49 -0
  13. package/dist/skills/frameworks/pulumi/package-usage/agents/openai.yaml +4 -0
  14. package/dist/skills/frameworks/pulumi/package-usage/use_cases.yaml +15 -0
  15. package/dist/skills/frameworks/pulumi/provider-upgrade/SKILL.md +332 -0
  16. package/dist/skills/frameworks/pulumi/provider-upgrade/agents/openai.yaml +4 -0
  17. package/dist/skills/frameworks/pulumi/provider-upgrade/references/diagnostic-toolbox.md +131 -0
  18. package/dist/skills/frameworks/pulumi/provider-upgrade/use_cases.yaml +28 -0
  19. package/dist/skills/frameworks/pulumi/pulumi-automation-api/SKILL.md +320 -0
  20. package/dist/skills/frameworks/pulumi/pulumi-automation-api/agents/openai.yaml +4 -0
  21. package/dist/skills/frameworks/pulumi/pulumi-automation-api/use_cases.yaml +7 -0
  22. package/dist/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +501 -0
  23. package/dist/skills/frameworks/pulumi/pulumi-best-practices/agents/openai.yaml +4 -0
  24. package/dist/skills/frameworks/pulumi/pulumi-best-practices/use_cases.yaml +7 -0
  25. package/dist/skills/frameworks/pulumi/pulumi-component/SKILL.md +830 -0
  26. package/dist/skills/frameworks/pulumi/pulumi-component/agents/openai.yaml +4 -0
  27. package/dist/skills/frameworks/pulumi/pulumi-component/use_cases.yaml +19 -0
  28. package/dist/skills/frameworks/pulumi/pulumi-esc/SKILL.md +281 -0
  29. package/dist/skills/frameworks/pulumi/pulumi-esc/agents/openai.yaml +4 -0
  30. package/dist/skills/frameworks/pulumi/pulumi-esc/use_cases.yaml +30 -0
  31. package/dist/skills/frameworks/pulumi/pulumi-overview/SKILL.md +289 -0
  32. package/dist/skills/frameworks/pulumi/pulumi-overview/use_cases.yaml +50 -0
  33. package/dist/skills/misc/timesheet/SKILL.md +87 -0
  34. package/dist/skills/misc/timesheet/scripts/git-timesheet-evidence.mjs +214 -0
  35. package/dist/skills/phases/goalify/SKILL.md +18 -54
  36. package/package.json +1 -1
  37. /package/dist/skills/agnostic/cli/{dp-cli → hi-cli}/references/post-command-flow.md +0 -0
@@ -0,0 +1,50 @@
1
+ # Queries that should activate the pulumi-overview skill.
2
+ #
3
+ # This skill is the entry-point router across the three Pulumi surfaces:
4
+ # L1 - ad-hoc, single-resource operations from the CLI (no project)
5
+ # L2 - Pulumi projects in a language
6
+ # L3 - Pulumi Cloud (ESC, policy, deployments, drift, schedules)
7
+ #
8
+ # L1 queries below are mostly plain infrastructure requests, the way a user
9
+ # (or non-Pulumi-aware agent) would naturally phrase them. Two L1 queries
10
+ # explicitly mention `pulumi do` to confirm that phrasing also routes here.
11
+ queries:
12
+ # L1 - ad-hoc single-resource infrastructure
13
+ - "Use pulumi do to create a Cloudflare DNS record"
14
+ - "Provision a one-off Auth0 application"
15
+ - "Register a Vercel deployment's domain in Cloudflare"
16
+ - "Set up a Datadog monitor"
17
+ - "Delete the S3 bucket I created earlier with pulumi do"
18
+ - "Provision an Azure virtual machine"
19
+ - "Create a Kubernetes namespace"
20
+ - "Spin up a single S3 bucket"
21
+
22
+ # L1 - multi-provider bootstrapping in one place
23
+ - "I need to provision an S3 bucket and point a Cloudflare DNS record at it"
24
+ - "Stand up a GCP storage bucket and a Datadog monitor for it in one go"
25
+ - "Bootstrap infrastructure across AWS, Cloudflare, and Auth0 from one CLI"
26
+ - "Set up infrastructure that spans AWS, GCP, and Cloudflare in one workflow"
27
+ - "Ad-hoc cloud resource CRUD across multiple providers without writing code"
28
+
29
+ # L2 - new project, picking the right level
30
+ - "Start a new Pulumi project in TypeScript for our AWS infrastructure"
31
+ - "Bootstrap a Pulumi project that provisions a VPC, subnets, and an EKS cluster"
32
+ - "Set up a Pulumi program for a multi-region application"
33
+
34
+ # L2 - graduating from L1 ad-hoc work
35
+ - "Move resources from a default stack into a named Pulumi project"
36
+ - "I've been creating resources with pulumi do, now I want to move them into a real Pulumi project"
37
+
38
+ # L3 - drift, policy, hosted runs
39
+ - "Set up nightly drift detection on my Pulumi production stack"
40
+ - "Add policy enforcement to our Pulumi previews"
41
+ - "Run my Pulumi updates in Pulumi Cloud instead of on a CI runner"
42
+
43
+ # Lifecycle - tear-down
44
+ - "Tear down our staging environment in Pulumi"
45
+ - "Destroy the dev stack and all the resources it created"
46
+
47
+ # Onboarding / first contact
48
+ - "I'm an agent that needs to use Pulumi -- where do I start?"
49
+ - "I'm an AI coding agent setting up Pulumi for the first time, what do I need to know?"
50
+ - "I'm new to Pulumi -- how do I structure a project for dev, staging, and prod stacks?"
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: timesheet
3
+ description: Builds a monthly timesheet draft from local git history, maps repo work to timesheet project codes, and fills the browser timesheet UI. Use when the user asks to compile, derive, or enter a timesheet from commits, git history, repo slugs, author names, or Crew Portal.
4
+ ---
5
+
6
+ # Timesheet
7
+
8
+ Turn local commit evidence into a draft timesheet. Never submit the final timesheet unless the user explicitly asks.
9
+
10
+ ## Inputs To Collect
11
+
12
+ Ask only for missing inputs:
13
+
14
+ - target month and year;
15
+ - repos root, default `~/Desktop/repos`;
16
+ - git author identities, including author names and email fragments;
17
+ - mapping from timesheet project code to repo slugs or paths;
18
+ - target timesheet URL and whether Browser plugin control is available.
19
+
20
+ When the user gives project labels but not mappings, ask for a compact mapping prompt:
21
+
22
+ ```text
23
+ Map each Crew project code to repo slugs/paths:
24
+ - DPINTA-DEV -> wearedevpunks-multiplai, devpunks-mkt-tool
25
+ - DPAICL-FD -> harness-intelligence, wearedevpunks-skills
26
+ - DUKAPP-FD -> traevolution-app
27
+ ```
28
+
29
+ If the Crew page is visible, read available project codes from the browser first, then ask the user to map unmatched repo slugs.
30
+
31
+ ## Git Evidence
32
+
33
+ Use the helper script for first-pass evidence:
34
+
35
+ ```bash
36
+ node skills/misc/timesheet/scripts/git-timesheet-evidence.mjs \
37
+ --month 2026-06 \
38
+ --repos-root ~/Desktop/repos \
39
+ --authors "stefan-garofalo,Stefan Garofalo,simosabba" \
40
+ --map "DPINTA-DEV=wearedevpunks-multiplai,devpunks-mkt-tool;DPAICL-FD=harness-intelligence,wearedevpunks-skills;DUKAPP-FD=traevolution-app"
41
+ ```
42
+
43
+ Rules:
44
+
45
+ - Fetch target repos first when network/auth is available; continue from local refs if fetch fails.
46
+ - Use author date for workday allocation; keep commit date visible when it differs.
47
+ - Match authors case-insensitively against author name and email.
48
+ - Deduplicate duplicate clones by `(project code, commit hash)`.
49
+ - Keep nearby identities visible but separate unless the user confirms they count.
50
+ - Report codes/repos with zero matching commits.
51
+
52
+ ## Allocation
53
+
54
+ Build a day-by-day ledger from evidence:
55
+
56
+ 1. For one project on a day, assign `1d`.
57
+ 2. For two projects on a day, assign `1/2d` each.
58
+ 3. If three or more projects appear but the sheet only supports `1d` and `1/2d`, propose a practical carry-forward or adjacent-day allocation and mark it as a timesheet-entry adjustment.
59
+ 4. Skip weekends if the UI disables them; fold weekend-only work into adjacent weekdays with matching project continuity.
60
+ 5. Verify each filled day totals exactly `1d`.
61
+ 6. Verify project totals and month total before browser entry.
62
+
63
+ ## Browser Fill
64
+
65
+ Use the `Browser` plugin when available. If it cannot attach to the user's external browser, open the same URL in the in-app browser and ask the user to sign in there.
66
+
67
+ Workflow:
68
+
69
+ 1. Open the timesheet URL and navigate to the target month.
70
+ 2. Read available project options and confirm they match the mapping.
71
+ 3. Turn on batch mode when the UI supports it.
72
+ 4. Fill larger groups first: project + duration + selected days + apply.
73
+ 5. After each apply, verify the logged total increased as expected.
74
+ 6. Do a final grid verification and project-total verification.
75
+ 7. Stop before `Submit timesheet` unless explicitly authorized.
76
+
77
+ Prefer stable DOM/role locators. If snapshots fail, use visible DOM or coordinate clicks only after a screenshot confirms the target.
78
+
79
+ ## Output
80
+
81
+ Report:
82
+
83
+ - exact days and project codes entered;
84
+ - project totals and month total;
85
+ - any zero-evidence projects;
86
+ - any adjusted days, such as weekend folding or three-project carry-forward;
87
+ - whether the sheet remains draft or was submitted by explicit request.
@@ -0,0 +1,214 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from "node:child_process";
3
+ import { existsSync, readdirSync, statSync } from "node:fs";
4
+ import { homedir } from "node:os";
5
+ import { join, resolve } from "node:path";
6
+
7
+ const args = parseArgs(process.argv.slice(2));
8
+ const month = requireArg(args.month, "--month YYYY-MM is required");
9
+ const reposRoot = expandHome(args["repos-root"] ?? "~/Desktop/repos");
10
+ const authorTerms = splitList(args.authors ?? "");
11
+ const mapSpec = args.map ?? "";
12
+
13
+ if (!/^\d{4}-\d{2}$/.test(month)) {
14
+ fail("--month must be YYYY-MM");
15
+ }
16
+ if (!authorTerms.length) {
17
+ fail("--authors is required, for example \"Stefan Garofalo,simosabba\"");
18
+ }
19
+
20
+ const projectMap = parseMap(mapSpec);
21
+ if (!Object.keys(projectMap).length) {
22
+ fail("--map is required, for example \"CODE=repo-a,repo-b;CODE2=repo-c\"");
23
+ }
24
+
25
+ const start = `${month}-01T00:00:00`;
26
+ const before = nextMonthStart(month);
27
+ const startDay = start.slice(0, 10);
28
+ const beforeDay = before.slice(0, 10);
29
+ const commitWindowDays = Number(args["commit-window-days"] ?? 45);
30
+ const commitBefore = addDays(beforeDay, commitWindowDays);
31
+ const authorPattern = new RegExp(authorTerms.map(escapeRegExp).join("|"), "i");
32
+ const rows = [];
33
+ const seen = new Set();
34
+ const repoReports = [];
35
+
36
+ for (const [code, slugs] of Object.entries(projectMap)) {
37
+ for (const slug of slugs) {
38
+ const repo = resolveRepo(reposRoot, slug);
39
+ if (!repo) {
40
+ repoReports.push({ code, slug, status: "missing" });
41
+ continue;
42
+ }
43
+ tryFetch(repo);
44
+ const commits = gitLog(repo, startDay, commitBefore).filter((commit) => (
45
+ commit.authorDate >= startDay && commit.authorDate < beforeDay
46
+ ));
47
+ let matched = 0;
48
+ for (const commit of commits) {
49
+ const haystack = `${commit.authorName} ${commit.authorEmail}`;
50
+ if (!authorPattern.test(haystack)) continue;
51
+ const key = `${code}:${commit.hash}`;
52
+ if (seen.has(key)) continue;
53
+ seen.add(key);
54
+ matched += 1;
55
+ rows.push({ code, slug, repo, ...commit });
56
+ }
57
+ repoReports.push({ code, slug, repo, status: "ok", matched });
58
+ }
59
+ }
60
+
61
+ rows.sort((a, b) => {
62
+ const byDate = a.authorDate.localeCompare(b.authorDate);
63
+ if (byDate) return byDate;
64
+ const byCode = a.code.localeCompare(b.code);
65
+ if (byCode) return byCode;
66
+ return a.subject.localeCompare(b.subject);
67
+ });
68
+
69
+ const byDay = new Map();
70
+ for (const row of rows) {
71
+ const day = row.authorDate.slice(0, 10);
72
+ const dayRows = byDay.get(day) ?? [];
73
+ dayRows.push(row);
74
+ byDay.set(day, dayRows);
75
+ }
76
+
77
+ console.log(`# Timesheet git evidence for ${month}`);
78
+ console.log("");
79
+ console.log(`Authors: ${authorTerms.join(", ")}`);
80
+ console.log(`Repos root: ${reposRoot}`);
81
+ console.log(`Commit scan window: ${startDay} to ${commitBefore}`);
82
+ console.log("");
83
+ console.log("## Repo coverage");
84
+ for (const report of repoReports) {
85
+ if (report.status === "missing") {
86
+ console.log(`- ${report.code} ${report.slug}: missing`);
87
+ } else {
88
+ console.log(`- ${report.code} ${report.slug}: ${report.matched} matching commits`);
89
+ }
90
+ }
91
+ console.log("");
92
+ console.log("## Day evidence");
93
+ for (const [day, dayRows] of byDay.entries()) {
94
+ const counts = countBy(dayRows, "code");
95
+ console.log(`- ${day}: ${Object.entries(counts).map(([code, count]) => `${code} ${count}`).join(", ")}`);
96
+ for (const row of dayRows.slice(0, 8)) {
97
+ const committed = row.commitDate === row.authorDate ? "" : `, committed ${row.commitDate}`;
98
+ console.log(` - ${row.code} ${row.hash.slice(0, 8)} ${row.slug}: ${row.subject}${committed}`);
99
+ }
100
+ if (dayRows.length > 8) console.log(` - ... ${dayRows.length - 8} more`);
101
+ }
102
+ console.log("");
103
+ console.log("## JSON");
104
+ console.log(JSON.stringify({ month, reposRoot, authors: authorTerms, repoReports, rows }, null, 2));
105
+
106
+ function parseArgs(argv) {
107
+ const out = {};
108
+ for (let i = 0; i < argv.length; i += 1) {
109
+ const arg = argv[i];
110
+ if (!arg.startsWith("--")) continue;
111
+ const key = arg.slice(2);
112
+ const next = argv[i + 1];
113
+ if (!next || next.startsWith("--")) out[key] = "true";
114
+ else {
115
+ out[key] = next;
116
+ i += 1;
117
+ }
118
+ }
119
+ return out;
120
+ }
121
+
122
+ function requireArg(value, message) {
123
+ if (!value) fail(message);
124
+ return value;
125
+ }
126
+
127
+ function splitList(value) {
128
+ return value.split(",").map((item) => item.trim()).filter(Boolean);
129
+ }
130
+
131
+ function parseMap(value) {
132
+ const out = {};
133
+ for (const part of value.split(";").map((item) => item.trim()).filter(Boolean)) {
134
+ const [code, slugsText] = part.split("=");
135
+ if (!code || !slugsText) fail(`Invalid --map part: ${part}`);
136
+ out[code.trim()] = splitList(slugsText);
137
+ }
138
+ return out;
139
+ }
140
+
141
+ function expandHome(path) {
142
+ if (path === "~") return homedir();
143
+ if (path.startsWith("~/")) return join(homedir(), path.slice(2));
144
+ return resolve(path);
145
+ }
146
+
147
+ function resolveRepo(root, slug) {
148
+ const direct = expandHome(slug);
149
+ if (existsSync(join(direct, ".git"))) return direct;
150
+ const underRoot = join(root, slug);
151
+ if (existsSync(join(underRoot, ".git"))) return underRoot;
152
+ if (!existsSync(root)) return null;
153
+ const matches = readdirSync(root)
154
+ .map((name) => join(root, name))
155
+ .filter((path) => statSync(path).isDirectory())
156
+ .filter((path) => existsSync(join(path, ".git")))
157
+ .filter((path) => path.toLowerCase().includes(slug.toLowerCase()));
158
+ return matches.length === 1 ? matches[0] : null;
159
+ }
160
+
161
+ function tryFetch(repo) {
162
+ try {
163
+ execFileSync("git", ["-C", repo, "fetch", "--all", "--prune"], { stdio: "ignore" });
164
+ } catch {
165
+ // Local refs are still useful when network or credentials are unavailable.
166
+ }
167
+ }
168
+
169
+ function gitLog(repo, since, before) {
170
+ const format = "%H%x1f%ad%x1f%cd%x1f%an%x1f%ae%x1f%s";
171
+ const output = execFileSync("git", [
172
+ "-C",
173
+ repo,
174
+ "log",
175
+ "--all",
176
+ `--since=${since}T00:00:00`,
177
+ `--before=${before}T00:00:00`,
178
+ "--date=format:%Y-%m-%d",
179
+ `--format=${format}`,
180
+ ], { encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
181
+ return output.split("\n").filter(Boolean).map((line) => {
182
+ const [hash, authorDate, commitDate, authorName, authorEmail, subject] = line.split("\x1f");
183
+ return { hash, authorDate, commitDate, authorName, authorEmail, subject };
184
+ });
185
+ }
186
+
187
+ function nextMonthStart(value) {
188
+ const [yearText, monthText] = value.split("-");
189
+ const year = Number(yearText);
190
+ const zeroMonth = Number(monthText) - 1;
191
+ const next = new Date(Date.UTC(year, zeroMonth + 1, 1));
192
+ return `${next.getUTCFullYear()}-${String(next.getUTCMonth() + 1).padStart(2, "0")}-01T00:00:00`;
193
+ }
194
+
195
+ function addDays(value, days) {
196
+ const date = new Date(`${value}T00:00:00Z`);
197
+ date.setUTCDate(date.getUTCDate() + days);
198
+ return date.toISOString().slice(0, 10);
199
+ }
200
+
201
+ function countBy(items, key) {
202
+ const out = {};
203
+ for (const item of items) out[item[key]] = (out[item[key]] ?? 0) + 1;
204
+ return out;
205
+ }
206
+
207
+ function escapeRegExp(value) {
208
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
209
+ }
210
+
211
+ function fail(message) {
212
+ console.error(message);
213
+ process.exit(1);
214
+ }
@@ -1,68 +1,32 @@
1
1
  ---
2
2
  name: goalify
3
- description: Goalify messy intent by writing a very lean `/goal`, activating it immediately with the available goal tool, and continuing the user's task under that active goal.
3
+ description: Goalify messy intent by generating and activating one lean goal immediately, then continuing work under it.
4
4
  ---
5
5
 
6
6
  # Goalify
7
7
 
8
- `goalify` writes the smallest operating contract a goal-running Codex can adopt,
9
- activates it immediately, then keeps working. It is a compiler, not a spec,
10
- handoff, or plan dump.
11
-
12
- Invocation is permission to activate now. Do not stop at printing a `/goal`
13
- prompt or reporting the contract when a goal tool is available.
14
-
15
- Be very lean. Target the shortest contract that can run without re-asking.
16
- Hard limit: text after `/goal` must be non-empty and <= 4,000 characters. If
17
- detail will not fit, point at a file instead of pasting overflow.
18
-
19
- ## Activation
20
-
21
- - Always activate spot on: write the goal, call the available goal activation
22
- tool immediately, then continue the user's task under that active goal.
23
- - If the task is tiny, unresolved, or lacks one objective, proof signal, and
24
- stop condition, ask one clarifying question.
25
- - If activation is unavailable, return the ready `/goal ...` prompt and name
26
- that blocker.
27
-
28
- ## Goal Contract
29
-
30
- Include only what the runner needs:
31
-
32
- - one durable objective
33
- - read-first refs: exact paths, issues, URLs, logs, artifacts
34
- - boundaries: scope, non-goals, constraints, guardrails
35
- - terse workflow checkpoints with named skills/tools/phases from context
36
- - proof: commands, scenarios, artifacts, logs, or other done evidence
37
- - stop: done condition, early-stop blocker, final report expectation
38
-
39
- Cut background, section catalogs, and repeated rationale. Preserve concrete
40
- paths, commands, ids, URLs, artifacts, and invariants.
8
+ `goalify` generates and activates the goal in one move, immediately. Invocation
9
+ is permission to create the active goal now and continue the user's task under
10
+ it.
41
11
 
42
12
  ## Workflow
43
13
 
44
14
  1. Read supplied handoffs, specs, issues, logs, examples, and scoped repo
45
- guidance. Prefer current repo/spec/log evidence over summaries.
46
- 2. Reduce to one objective. Move adjacent wishes to boundaries, follow-ups, or
47
- blockers.
48
- 3. Write a direct, pointer-heavy `/goal` contract. Use [EXAMPLES.md](EXAMPLES.md)
49
- only if structure is needed.
50
- 4. Check: one objective, explicit proof, stop/blocker conditions, no secrets, no
51
- vague "make it work", <= 4,000 characters.
52
- 5. Activate immediately. After activation succeeds, continue execution; report
53
- only what helps the active task move forward.
15
+ guidance.
16
+ 2. Reduce the request to one durable objective with proof and stop conditions.
17
+ 3. Write the smallest `/goal` contract that can run without re-asking.
18
+ 4. Activate that goal immediately, then keep working under the active goal.
19
+ 5. Report only progress, blockers, and final proof relevant to that active goal.
54
20
 
55
- ## Fallback Output
21
+ ## Contract
56
22
 
57
- Use only when activation cannot run:
23
+ Include only:
58
24
 
59
- 1. fenced `text` block with the ready `/goal ...` prompt
60
- 2. character count
61
- 3. activation blocker
62
-
63
- ## Gotchas
25
+ - objective: one outcome
26
+ - context: exact paths, issues, URLs, logs, artifacts, and constraints
27
+ - workflow: terse checkpoints with named skills, tools, or phases from context
28
+ - proof: commands, scenarios, artifacts, logs, or other done evidence
29
+ - stop: done condition, early-stop blocker, and final report expectation
64
30
 
65
- - Do not turn a backlog grab bag into one goal; split or ask.
66
- - Do not hardcode project-specific phase families; use the context provided.
67
- - Do not tell the runner to mutate fixtures, recordings, handoffs, or test
68
- inputs unless the user explicitly asks.
31
+ Keep it pointer-heavy, no secrets, no vague "make it work", and <= 4,000
32
+ characters after `/goal`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/cli",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Harness Intelligence scaffolding CLI",
5
5
  "bin": {
6
6
  "hi": "dist/index.js",