@codeam/shared 2.61.74 → 2.61.76

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 CHANGED
@@ -721,7 +721,7 @@ interface AgentReviewReport {
721
721
  }
722
722
 
723
723
  /** Curated skills shipped with the client. Grows over time. */
724
- type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development';
724
+ type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development' | 'code-naming';
725
725
  /** Delivery rails, twin of IntegrationDelivery's mcp/cliEnv. */
726
726
  type SkillRail = 'skillFile' | 'instruction';
727
727
  /** `skillFile` payload — a Claude-Code SKILL.md bundle (body + optional files). */
package/dist/index.d.ts CHANGED
@@ -721,7 +721,7 @@ interface AgentReviewReport {
721
721
  }
722
722
 
723
723
  /** Curated skills shipped with the client. Grows over time. */
724
- type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development';
724
+ type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development' | 'code-naming';
725
725
  /** Delivery rails, twin of IntegrationDelivery's mcp/cliEnv. */
726
726
  type SkillRail = 'skillFile' | 'instruction';
727
727
  /** `skillFile` payload — a Claude-Code SKILL.md bundle (body + optional files). */
package/dist/index.js CHANGED
@@ -2125,11 +2125,110 @@ var specDrivenDevelopmentSkill = {
2125
2125
  }
2126
2126
  };
2127
2127
 
2128
+ // src/skills/code-naming.ts
2129
+ var CODE_NAMING_BODY = `Use this skill when NAMING or RENAMING code \u2014 variables, functions, classes,
2130
+ interfaces, types, files, modules, components, hooks, constants \u2014 while writing
2131
+ new code, refactoring, or reviewing a diff. A name should reveal intent and
2132
+ domain meaning so a reader understands the code without translating it in their
2133
+ head, and so it needs fewer comments.
2134
+
2135
+ ## The five core rules (name the concept, not the implementation)
2136
+
2137
+ 1. **Don't abbreviate, and don't use single letters for meaningful values.**
2138
+ \`usr\`/\`cfg\`/\`authReq\` \u2192 \`user\`/\`config\`/\`authRequest\`; \`u\`/\`p\` \u2192 \`user\`/\`project\`.
2139
+ Abbreviations rely on context the next reader may not have. Allowed: standard
2140
+ acronyms the domain already uses (API, URL, HTTP, ID, UUID, CLI, SDK, PR, OAuth),
2141
+ loop indices \`i\`/\`j\`, coordinates \`x\`/\`y\`, and generic type params \`T\`/\`K\`/\`V\`.
2142
+
2143
+ 2. **Don't put the data TYPE in a variable name.** \`userList\` \u2192 \`users\`,
2144
+ \`nameString\` \u2192 \`displayName\`, \`isActiveBool\` \u2192 \`isActive\`, \`invoiceMap\` \u2192
2145
+ \`invoicesById\`. The type system and editor already show the type; the name
2146
+ should carry the meaning.
2147
+
2148
+ 3. **Include the UNIT when a number has one** (unless the type makes it
2149
+ unmistakable). \`timeout\` \u2192 \`timeoutMs\`, \`delay\` \u2192 \`retryDelaySeconds\`,
2150
+ \`size\` \u2192 \`fileSizeBytes\`, \`price\` \u2192 \`priceUsd\`. Especially time, distance,
2151
+ money, bytes, rates, percentages, token/rate limits.
2152
+
2153
+ 4. **Don't put the type CONSTRUCT in a type's name.** \`UserClass\` \u2192 \`User\`,
2154
+ \`PaymentInterface\`/\`IPayment\` \u2192 \`Payment\` (or a role like \`PaymentGateway\`),
2155
+ \`ConfigType\` \u2192 \`Config\`, \`StatusEnum\` \u2192 \`Status\`. Name the concept, not
2156
+ "what kind of programming thing it is."
2157
+
2158
+ 5. **Refactor when you're reaching for \`Utils\`/\`Helpers\`/\`Common\`.** A generic
2159
+ bucket usually hides a missing concept. Group by domain instead:
2160
+ \`utils/parseCookie\` \u2192 a \`cookies/\` module or a \`CookieStore\`/\`CookieJar\` class;
2161
+ \`utils/formatDate\` \u2192 \`dates/\` or a \`DateRangeFormatter\`. Same for vague
2162
+ \`Base\`/\`Abstract\`/\`Manager\`/\`Helper\` class names \u2014 prefer the role
2163
+ (\`Repository\`, \`BillingService\`, \`UserProvisioner\`) unless the project
2164
+ convention explicitly requires \`Base\`/\`Abstract\`.
2165
+
2166
+ ## Shape rules
2167
+
2168
+ - **Functions are verbs / verb phrases:** \`createInvoice()\`, \`sendPasswordResetEmail()\`,
2169
+ \`findRepositoryById()\`. Booleans read like a question in an \`if\`:
2170
+ \`isActive\`, \`hasAccess\`, \`canDeploy\`, \`shouldRetry\` (prefix \`is/has/can/should/needs\`).
2171
+ - **Classes / interfaces / types are nouns or roles:** \`Invoice\`, \`PaymentGateway\`,
2172
+ \`AgentSession\` \u2014 not \`InvoiceData\`, \`SubscriptionThing\`, \`AgentSessionType\`.
2173
+ - **Collections are plural, or \`\u2026ById\`/\`\u2026ByX\` when indexed:** \`users\`,
2174
+ \`activeSessions\`, \`invoicesByCustomerId\`.
2175
+ - **Don't encode a temporary implementation in a name that may change:**
2176
+ \`postgresUserRepository\` \u2192 \`userRepository\`, \`redisCache\` \u2192 \`cache\` \u2014 unless the
2177
+ implementation IS the meaningful distinction. Name the role, not today's backend.
2178
+ - **Follow the project's existing conventions** (casing, file naming, \`useX\`
2179
+ hooks, \`handleX\` handlers). Match the surrounding code; don't introduce a new
2180
+ style without a strong reason.
2181
+
2182
+ ## Words to distrust (infer the real role, then name it)
2183
+
2184
+ \`data\`, \`info\`, \`item\`, \`obj\`, \`temp\`, \`result\`, \`value\`, \`thing\`, \`stuff\`,
2185
+ \`manager\`, \`helper\`, \`utils\`, \`common\`, \`base\`, \`abstract\`, \`processor\`,
2186
+ \`handler\`, \`payload\`. They're acceptable only when the surrounding context makes
2187
+ them precise (e.g. \`config\` inside one \`DatabaseConnection\`); vague when passed
2188
+ across many layers.
2189
+
2190
+ ## Guardrails \u2014 this is a review/refactor guide, NOT a mass-rename mandate
2191
+
2192
+ - Names that are already clear and idiomatic are DONE \u2014 leave them.
2193
+ - Before renaming: read how the identifier is used and infer the real domain
2194
+ concept. Prefer the **smallest** clear rename.
2195
+ - Do NOT do large unrelated renames, and do NOT rename purely for personal
2196
+ preference. Stay inside the change you were asked to make.
2197
+ - Preserve public API / exported names unless the task explicitly allows a break;
2198
+ when you do rename, update every reference, tests, and docs in the same change.
2199
+ - No clever names, jokes, or metaphors in production code; don't make names
2200
+ needlessly long either.
2201
+
2202
+ When reviewing, raise a naming issue only when a clearer name would materially
2203
+ help a reader \u2014 one suggestion per finding: \`current \u2192 suggested \u2014 why\`.`;
2204
+ var CODE_NAMING_INSTRUCTION = `When naming or renaming code, name the domain concept, not the implementation:
2205
+ no abbreviations or single-letter names for meaningful values (standard acronyms
2206
+ like API/URL/ID/OAuth are fine); don't put the data type in a variable name
2207
+ (userList \u2192 users); include the unit when a number has one (timeout \u2192 timeoutMs);
2208
+ don't put the type construct in a type's name (IPayment \u2192 Payment); and refactor
2209
+ generic Utils/Helper/Manager/Base buckets into a domain module or a role-named
2210
+ class. Functions are verbs (createInvoice), booleans read like questions
2211
+ (isActive/hasAccess), classes/types are nouns/roles, collections are plural or
2212
+ \u2026ById. This is a review/refactor guide, not a mandate to mass-rename: leave
2213
+ already-clear names alone, prefer the smallest clear rename, don't rename
2214
+ unrelated code, and preserve public/exported names unless the task allows a break.`;
2215
+ var codeNamingSkill = {
2216
+ id: "code-naming",
2217
+ name: "Code Naming",
2218
+ description: `Naming review & refactor: name the domain concept, not the implementation \u2014 no abbreviations, no type-in-name, units when they matter, no Utils/Manager/Base buckets; rename minimally, never mass-rename.`,
2219
+ source: "curated",
2220
+ delivery: {
2221
+ skillFile: { body: CODE_NAMING_BODY },
2222
+ instruction: { body: CODE_NAMING_INSTRUCTION }
2223
+ }
2224
+ };
2225
+
2128
2226
  // src/skills/registry.ts
2129
2227
  var SKILL_REGISTRY = {
2130
2228
  "code-review": codeReviewSkill,
2131
2229
  "resolve-conflicts": resolveConflictsSkill,
2132
- "spec-driven-development": specDrivenDevelopmentSkill
2230
+ "spec-driven-development": specDrivenDevelopmentSkill,
2231
+ "code-naming": codeNamingSkill
2133
2232
  };
2134
2233
  function isSkillId(id) {
2135
2234
  return Object.prototype.hasOwnProperty.call(SKILL_REGISTRY, id);