@codeam/shared 2.61.25 → 2.61.27
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/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +145 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +145 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -615,7 +615,7 @@ interface AgentReviewReport {
|
|
|
615
615
|
}
|
|
616
616
|
|
|
617
617
|
/** Curated skills shipped with the client. Grows over time. */
|
|
618
|
-
type SkillId = 'code-review' | 'resolve-conflicts';
|
|
618
|
+
type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development';
|
|
619
619
|
/** Delivery rails, twin of IntegrationDelivery's mcp/cliEnv. */
|
|
620
620
|
type SkillRail = 'skillFile' | 'instruction';
|
|
621
621
|
/** `skillFile` payload — a Claude-Code SKILL.md bundle (body + optional files). */
|
|
@@ -1469,6 +1469,11 @@ declare const USER_EVENTS: {
|
|
|
1469
1469
|
readonly CODERABBIT_STATUS: "coderabbit_status";
|
|
1470
1470
|
readonly CODERABBIT_REVIEW: "coderabbit_review";
|
|
1471
1471
|
readonly VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete";
|
|
1472
|
+
/** PR-review launch progress toast — the "Review with an agent" flow shows a
|
|
1473
|
+
* toast when the review runs server-side (Inngest). Mobile-only surface,
|
|
1474
|
+
* produced by api-v2 (the CLI neither produces nor consumes it). Mirrored in
|
|
1475
|
+
* repo A. */
|
|
1476
|
+
readonly PR_REVIEW_LAUNCH: "pr_review_launch";
|
|
1472
1477
|
};
|
|
1473
1478
|
type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
1474
1479
|
|
package/dist/index.d.ts
CHANGED
|
@@ -615,7 +615,7 @@ interface AgentReviewReport {
|
|
|
615
615
|
}
|
|
616
616
|
|
|
617
617
|
/** Curated skills shipped with the client. Grows over time. */
|
|
618
|
-
type SkillId = 'code-review' | 'resolve-conflicts';
|
|
618
|
+
type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development';
|
|
619
619
|
/** Delivery rails, twin of IntegrationDelivery's mcp/cliEnv. */
|
|
620
620
|
type SkillRail = 'skillFile' | 'instruction';
|
|
621
621
|
/** `skillFile` payload — a Claude-Code SKILL.md bundle (body + optional files). */
|
|
@@ -1469,6 +1469,11 @@ declare const USER_EVENTS: {
|
|
|
1469
1469
|
readonly CODERABBIT_STATUS: "coderabbit_status";
|
|
1470
1470
|
readonly CODERABBIT_REVIEW: "coderabbit_review";
|
|
1471
1471
|
readonly VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete";
|
|
1472
|
+
/** PR-review launch progress toast — the "Review with an agent" flow shows a
|
|
1473
|
+
* toast when the review runs server-side (Inngest). Mobile-only surface,
|
|
1474
|
+
* produced by api-v2 (the CLI neither produces nor consumes it). Mirrored in
|
|
1475
|
+
* repo A. */
|
|
1476
|
+
readonly PR_REVIEW_LAUNCH: "pr_review_launch";
|
|
1472
1477
|
};
|
|
1473
1478
|
type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
1474
1479
|
|
package/dist/index.js
CHANGED
|
@@ -1104,7 +1104,7 @@ function getIntegrationBranding(id) {
|
|
|
1104
1104
|
return INTEGRATION_BRANDING[id] ?? null;
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
|
-
// src/skills/
|
|
1107
|
+
// src/skills/code-review.ts
|
|
1108
1108
|
var CODE_REVIEW_BODY = `Use this skill when reviewing a pull request. It defines what a high-signal
|
|
1109
1109
|
review looks like so your inline comments are worth the author's time.
|
|
1110
1110
|
|
|
@@ -1137,6 +1137,18 @@ line, each led by a severity tag (blocker/should-fix/nit) and a concrete reason
|
|
|
1137
1137
|
(the failure scenario or risk), not a restatement of the diff. If the change is
|
|
1138
1138
|
correct and well-tested, approve and say so \u2014 finding nothing is a valid outcome.
|
|
1139
1139
|
Review only the diff and its direct blast radius; do not demand unrelated refactors.`;
|
|
1140
|
+
var codeReviewSkill = {
|
|
1141
|
+
id: "code-review",
|
|
1142
|
+
name: "Code Review",
|
|
1143
|
+
description: `High-signal PR review: prioritize correctness \u2192 security \u2192 tests \u2192 clarity, one anchored finding per comment.`,
|
|
1144
|
+
source: "curated",
|
|
1145
|
+
delivery: {
|
|
1146
|
+
skillFile: { body: CODE_REVIEW_BODY },
|
|
1147
|
+
instruction: { body: CODE_REVIEW_INSTRUCTION }
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
|
+
// src/skills/resolve-conflicts.ts
|
|
1140
1152
|
var RESOLVE_CONFLICTS_BODY = `Use this skill when resolving merge conflicts on a pull request. The goal is a
|
|
1141
1153
|
merge that preserves BOTH sides' intent, not one that just makes the file compile.
|
|
1142
1154
|
|
|
@@ -1160,28 +1172,134 @@ and prefer a union of intents; drop a side only when the two are mutually exclus
|
|
|
1160
1172
|
keeping the side that matches the PR's purpose. Leave no conflict markers behind
|
|
1161
1173
|
(grep for them). Regenerate lockfiles rather than hand-merging them. The result must
|
|
1162
1174
|
build and pass tests \u2014 run them \u2014 before you commit and push.`;
|
|
1163
|
-
var
|
|
1164
|
-
"
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
instruction: { body: CODE_REVIEW_INSTRUCTION }
|
|
1172
|
-
}
|
|
1173
|
-
},
|
|
1174
|
-
"resolve-conflicts": {
|
|
1175
|
-
id: "resolve-conflicts",
|
|
1176
|
-
name: "Resolve Conflicts",
|
|
1177
|
-
description: `Merge-conflict resolution that preserves both sides' intent, leaves no markers, and keeps the build green.`,
|
|
1178
|
-
source: "curated",
|
|
1179
|
-
delivery: {
|
|
1180
|
-
skillFile: { body: RESOLVE_CONFLICTS_BODY },
|
|
1181
|
-
instruction: { body: RESOLVE_CONFLICTS_INSTRUCTION }
|
|
1182
|
-
}
|
|
1175
|
+
var resolveConflictsSkill = {
|
|
1176
|
+
id: "resolve-conflicts",
|
|
1177
|
+
name: "Resolve Conflicts",
|
|
1178
|
+
description: `Merge-conflict resolution that preserves both sides' intent, leaves no markers, and keeps the build green.`,
|
|
1179
|
+
source: "curated",
|
|
1180
|
+
delivery: {
|
|
1181
|
+
skillFile: { body: RESOLVE_CONFLICTS_BODY },
|
|
1182
|
+
instruction: { body: RESOLVE_CONFLICTS_INSTRUCTION }
|
|
1183
1183
|
}
|
|
1184
1184
|
};
|
|
1185
|
+
|
|
1186
|
+
// src/skills/spec-driven-development.ts
|
|
1187
|
+
var SPEC_DRIVEN_BODY = `Use this skill for any coding task that isn't a trivial one-liner. Build the right
|
|
1188
|
+
thing, provably, with the least ceremony the task warrants \u2014 specification before
|
|
1189
|
+
code, but its depth scales to the work. Skipping it yields code that looks right yet
|
|
1190
|
+
solves the wrong problem or breaks something you never checked.
|
|
1191
|
+
|
|
1192
|
+
## Step 0 \u2014 Right-size the work (always first)
|
|
1193
|
+
- **Quick** \u2014 a typo, copy tweak, one-line fix, a single file with no unknowns.
|
|
1194
|
+
No ceremony: make the change, run the relevant test/build, confirm it. Do NOT
|
|
1195
|
+
write a spec for a typo.
|
|
1196
|
+
- **Standard** \u2014 a feature or fix across a few files, some unknowns, a testable
|
|
1197
|
+
outcome. A light inline pass (a 2-3 sentence spec + a short plan), then build
|
|
1198
|
+
test-first, then verify. No scaffolding files.
|
|
1199
|
+
- **Deep** \u2014 large, ambiguous, risky, or touching many files / shared contracts /
|
|
1200
|
+
data / auth. The full flow below, tracking the work in beads (\`bd\`), not scratch
|
|
1201
|
+
files.
|
|
1202
|
+
When unsure, start one level lighter and escalate the moment real ambiguity or risk
|
|
1203
|
+
appears. State which level you picked in one line.
|
|
1204
|
+
|
|
1205
|
+
## Step 1 \u2014 Ground in the real codebase (before specifying anything non-trivial)
|
|
1206
|
+
You are almost never in a greenfield. Before you spec or plan, survey the real code:
|
|
1207
|
+
the existing patterns for this kind of change, the files you'll touch, the test
|
|
1208
|
+
setup, prior art, and the constraints (auth, data, shared types, CLAUDE.md
|
|
1209
|
+
conventions). A spec written in a vacuum produces a plan that fights the codebase.
|
|
1210
|
+
Read first; never assume.
|
|
1211
|
+
|
|
1212
|
+
## Step 2 \u2014 Specify: the WHAT and WHY (not the HOW)
|
|
1213
|
+
State the user-visible outcome and why it matters, then the acceptance criteria \u2014
|
|
1214
|
+
each concrete and testable ("tapping X shows Y", "the endpoint returns 409 when Z"),
|
|
1215
|
+
never vague ("works well"). List what is out of scope. Put NO implementation detail
|
|
1216
|
+
here (no file names, no libraries). If a requirement is ambiguous, mark it rather
|
|
1217
|
+
than guess.
|
|
1218
|
+
|
|
1219
|
+
## Step 3 \u2014 Clarify: resolve ambiguity, but don't stall
|
|
1220
|
+
Gather the ambiguities that would actually change what you build. Ask the
|
|
1221
|
+
highest-leverage ones \u2014 batched, at most ~3, phrased as concrete choices. For
|
|
1222
|
+
low-stakes unknowns, pick a sensible default and SAY so ("assuming X unless you tell
|
|
1223
|
+
me otherwise") instead of asking. On a conversational/mobile client every round-trip
|
|
1224
|
+
is expensive \u2014 don't pester; decide what you safely can.
|
|
1225
|
+
|
|
1226
|
+
## Step 4 \u2014 Plan: the HOW, grounded and simple
|
|
1227
|
+
Design against the real code. Apply the simplicity gates before committing:
|
|
1228
|
+
- **Fewest moving parts** that satisfy the criteria. If you add a layer or
|
|
1229
|
+
abstraction, justify it or drop it.
|
|
1230
|
+
- **Use the framework/library directly** \u2014 don't wrap it for flexibility you don't
|
|
1231
|
+
need yet.
|
|
1232
|
+
- **Minimal blast radius** \u2014 touch what the change needs, nothing more.
|
|
1233
|
+
State the test strategy (what proves each criterion) and name the real risks. Keep
|
|
1234
|
+
the plan short.
|
|
1235
|
+
|
|
1236
|
+
## Step 5 \u2014 Tasks: small, verifiable, ordered
|
|
1237
|
+
Split the plan into tasks that each end in something you can run and check. Mark
|
|
1238
|
+
independent ones as parallelizable. Each task is the smallest unit worth its own
|
|
1239
|
+
check. Sequence by dependency.
|
|
1240
|
+
|
|
1241
|
+
## Step 6 \u2014 Implement: test-first by default
|
|
1242
|
+
For each task: write the test that would fail without the change, watch it fail, make
|
|
1243
|
+
it pass, keep it green. Follow the patterns you found in Step 1. Commit in logical
|
|
1244
|
+
units. Escape hatch: for a genuine spike or exploratory UI where test-first is
|
|
1245
|
+
impractical, say so explicitly and add the test right after \u2014 never skip it silently.
|
|
1246
|
+
|
|
1247
|
+
## Step 7 \u2014 Verify + self-review (what separates "done" from "looks done")
|
|
1248
|
+
Return to the acceptance criteria and prove EACH one is met \u2014 run the tests, diff the
|
|
1249
|
+
behavior, look at the real output. Then review your own work adversarially:
|
|
1250
|
+
- What did I NOT test?
|
|
1251
|
+
- What did I change that I didn't need to?
|
|
1252
|
+
- What could this have broken (the blast radius)?
|
|
1253
|
+
- Does anything contradict the spec?
|
|
1254
|
+
Fix what you find before declaring done. "The tests I wrote pass" is not "it works".
|
|
1255
|
+
|
|
1256
|
+
## Step 8 \u2014 Done + handoff
|
|
1257
|
+
Done means acceptance criteria met, tests green, no known regressions. Summarize what
|
|
1258
|
+
changed in plain terms. File any deferred work or follow-ups to beads (\`bd\`) so
|
|
1259
|
+
nothing is lost. Never claim done on unverified work.
|
|
1260
|
+
|
|
1261
|
+
## Principles (the constitution)
|
|
1262
|
+
- Clarify before you build; verify before you call it done.
|
|
1263
|
+
- Testable beats descriptive \u2014 a criterion you can't check isn't one.
|
|
1264
|
+
- Grounded beats greenfield \u2014 fit the codebase that exists.
|
|
1265
|
+
- Simple beats clever \u2014 the least structure that works.
|
|
1266
|
+
- Scale the process to the task \u2014 ceremony on a typo is a bug.
|
|
1267
|
+
- Real work goes to beads, not throwaway files in someone's repo.`;
|
|
1268
|
+
var SPEC_DRIVEN_INSTRUCTION = `Follow spec-driven development, scaled to the task:
|
|
1269
|
+
1. Right-size first. A trivial change (typo, one file, no unknowns) \u2192 just make it
|
|
1270
|
+
well and verify, no ceremony. A feature/ambiguous/risky change \u2192 spec \u2192 plan \u2192
|
|
1271
|
+
build \u2192 verify.
|
|
1272
|
+
2. Ground in the real codebase before planning \u2014 read the existing patterns, tests,
|
|
1273
|
+
and constraints. Never assume; read first.
|
|
1274
|
+
3. Specify the WHAT and WHY as testable acceptance criteria, not the HOW. Mark
|
|
1275
|
+
ambiguities instead of guessing.
|
|
1276
|
+
4. Clarify only the highest-leverage unknowns (batch <=3, concrete choices); default
|
|
1277
|
+
the low-stakes ones and say so. Don't stall on round-trips.
|
|
1278
|
+
5. Plan the simplest approach that fits the code: fewest moving parts, use libraries
|
|
1279
|
+
directly, minimal blast radius. State how each criterion will be tested.
|
|
1280
|
+
6. Implement test-first by default; follow existing patterns; commit in logical units.
|
|
1281
|
+
7. Verify EACH acceptance criterion (run tests, diff behavior), then self-review
|
|
1282
|
+
adversarially: what's untested? what did I change needlessly? what could I have
|
|
1283
|
+
broken? what contradicts the spec? Fix before declaring done.
|
|
1284
|
+
8. Track deferred work in beads (bd), not scratch files. Simple beats clever; verify
|
|
1285
|
+
before done.`;
|
|
1286
|
+
var specDrivenDevelopmentSkill = {
|
|
1287
|
+
id: "spec-driven-development",
|
|
1288
|
+
name: "Spec-Driven Development",
|
|
1289
|
+
description: `Spec-driven development scaled to the task: right-size, ground in the code, write testable acceptance criteria, plan simply, build test-first, and verify every criterion before done.`,
|
|
1290
|
+
source: "curated",
|
|
1291
|
+
delivery: {
|
|
1292
|
+
skillFile: { body: SPEC_DRIVEN_BODY },
|
|
1293
|
+
instruction: { body: SPEC_DRIVEN_INSTRUCTION }
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
|
|
1297
|
+
// src/skills/registry.ts
|
|
1298
|
+
var SKILL_REGISTRY = {
|
|
1299
|
+
"code-review": codeReviewSkill,
|
|
1300
|
+
"resolve-conflicts": resolveConflictsSkill,
|
|
1301
|
+
"spec-driven-development": specDrivenDevelopmentSkill
|
|
1302
|
+
};
|
|
1185
1303
|
function isSkillId(id) {
|
|
1186
1304
|
return Object.prototype.hasOwnProperty.call(SKILL_REGISTRY, id);
|
|
1187
1305
|
}
|
|
@@ -1329,7 +1447,12 @@ var USER_EVENTS = {
|
|
|
1329
1447
|
// VCS / PR Command Center — the backend publishes this after an agent finishes
|
|
1330
1448
|
// reviewing a PR (verdict + comment count + findings), driving the mobile
|
|
1331
1449
|
// completion screen + push. Mirrored in repo A's app-shared events.ts.
|
|
1332
|
-
VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete"
|
|
1450
|
+
VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete",
|
|
1451
|
+
/** PR-review launch progress toast — the "Review with an agent" flow shows a
|
|
1452
|
+
* toast when the review runs server-side (Inngest). Mobile-only surface,
|
|
1453
|
+
* produced by api-v2 (the CLI neither produces nor consumes it). Mirrored in
|
|
1454
|
+
* repo A. */
|
|
1455
|
+
PR_REVIEW_LAUNCH: "pr_review_launch"
|
|
1333
1456
|
};
|
|
1334
1457
|
|
|
1335
1458
|
// src/preview-prompts.ts
|