@spekn/cli 1.0.3 → 1.0.5

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/dist/main.js +72 -49
  2. package/dist/resources/prompts/repo-sync-analysis.prompt.md +1 -1
  3. package/dist/tui/index.mjs +4745 -537
  4. package/package.json +3 -3
  5. package/dist/tui/chunk-4WEASLXY.mjs +0 -3444
  6. package/dist/tui/chunk-755CADEG.mjs +0 -3401
  7. package/dist/tui/chunk-BUJQVTY5.mjs +0 -3409
  8. package/dist/tui/chunk-BZKKMGFB.mjs +0 -1959
  9. package/dist/tui/chunk-DJYOBCNM.mjs +0 -3159
  10. package/dist/tui/chunk-GTFTFDY4.mjs +0 -3417
  11. package/dist/tui/chunk-IMEBD2KA.mjs +0 -3444
  12. package/dist/tui/chunk-IX6DR5SW.mjs +0 -3433
  13. package/dist/tui/chunk-JKFOY4IF.mjs +0 -2003
  14. package/dist/tui/chunk-OXXZ3O5L.mjs +0 -3378
  15. package/dist/tui/chunk-SHJNIAAJ.mjs +0 -1697
  16. package/dist/tui/chunk-V4SNDRUS.mjs +0 -1666
  17. package/dist/tui/chunk-VXVHNZST.mjs +0 -1666
  18. package/dist/tui/chunk-WCTSFKTA.mjs +0 -3459
  19. package/dist/tui/chunk-X2XP5ACW.mjs +0 -3443
  20. package/dist/tui/chunk-YUYJ7VBG.mjs +0 -2029
  21. package/dist/tui/chunk-ZM3EI5IA.mjs +0 -3384
  22. package/dist/tui/chunk-ZYOX64HP.mjs +0 -1653
  23. package/dist/tui/use-session-store-63YUGUFA.mjs +0 -8
  24. package/dist/tui/use-session-store-ACO2SMJC.mjs +0 -8
  25. package/dist/tui/use-session-store-BVFDAWOB.mjs +0 -8
  26. package/dist/tui/use-session-store-DJIZ3FQZ.mjs +0 -9
  27. package/dist/tui/use-session-store-EAIQA4UG.mjs +0 -9
  28. package/dist/tui/use-session-store-EFBAXC3G.mjs +0 -8
  29. package/dist/tui/use-session-store-FJOR4KTG.mjs +0 -8
  30. package/dist/tui/use-session-store-IJE5KVOC.mjs +0 -8
  31. package/dist/tui/use-session-store-KGAFXCKI.mjs +0 -8
  32. package/dist/tui/use-session-store-KS4DPNDY.mjs +0 -8
  33. package/dist/tui/use-session-store-MMHJENNL.mjs +0 -8
  34. package/dist/tui/use-session-store-OZ6HC4I2.mjs +0 -9
  35. package/dist/tui/use-session-store-PTMWISNJ.mjs +0 -8
  36. package/dist/tui/use-session-store-VCDECQMW.mjs +0 -8
  37. package/dist/tui/use-session-store-VOK5ML5J.mjs +0 -9
package/dist/main.js CHANGED
@@ -6123,8 +6123,8 @@ var require_SpecificationGeneration = __commonJS({
6123
6123
  status;
6124
6124
  content;
6125
6125
  frontmatter;
6126
- lockedBy;
6127
- lockedAt;
6126
+ activatedBy;
6127
+ activatedAt;
6128
6128
  qualityScore;
6129
6129
  qualityGrade;
6130
6130
  qualityBreakdown;
@@ -6171,13 +6171,13 @@ var require_SpecificationGeneration = __commonJS({
6171
6171
  nullable: true
6172
6172
  }),
6173
6173
  __metadata("design:type", String)
6174
- ], SpecificationGeneration.prototype, "lockedBy", void 0);
6174
+ ], SpecificationGeneration.prototype, "activatedBy", void 0);
6175
6175
  __decorate([
6176
6176
  (0, typeorm_1.Column)("timestamp", {
6177
6177
  nullable: true
6178
6178
  }),
6179
6179
  __metadata("design:type", Date)
6180
- ], SpecificationGeneration.prototype, "lockedAt", void 0);
6180
+ ], SpecificationGeneration.prototype, "activatedAt", void 0);
6181
6181
  __decorate([
6182
6182
  (0, typeorm_1.Column)("integer", {
6183
6183
  nullable: true
@@ -6274,7 +6274,7 @@ var require_Specification = __commonJS({
6274
6274
  (function(SpecificationStatus2) {
6275
6275
  SpecificationStatus2["DRAFT"] = "draft";
6276
6276
  SpecificationStatus2["REVIEW"] = "review";
6277
- SpecificationStatus2["LOCKED"] = "locked";
6277
+ SpecificationStatus2["ACTIVE"] = "active";
6278
6278
  SpecificationStatus2["ARCHIVED"] = "archived";
6279
6279
  })(SpecificationStatus || (exports2.SpecificationStatus = SpecificationStatus = {}));
6280
6280
  var Specification2 = class Specification {
@@ -6287,9 +6287,6 @@ var require_Specification = __commonJS({
6287
6287
  status;
6288
6288
  version;
6289
6289
  specRef;
6290
- isLocked;
6291
- lockedBy;
6292
- lockedAt;
6293
6290
  frontmatter;
6294
6291
  project;
6295
6292
  projectId;
@@ -6343,24 +6340,6 @@ var require_Specification = __commonJS({
6343
6340
  }),
6344
6341
  __metadata("design:type", String)
6345
6342
  ], Specification2.prototype, "specRef", void 0);
6346
- __decorate([
6347
- (0, typeorm_1.Column)("boolean", {
6348
- default: false
6349
- }),
6350
- __metadata("design:type", Boolean)
6351
- ], Specification2.prototype, "isLocked", void 0);
6352
- __decorate([
6353
- (0, typeorm_1.Column)("text", {
6354
- nullable: true
6355
- }),
6356
- __metadata("design:type", String)
6357
- ], Specification2.prototype, "lockedBy", void 0);
6358
- __decorate([
6359
- (0, typeorm_1.Column)("timestamp", {
6360
- nullable: true
6361
- }),
6362
- __metadata("design:type", Date)
6363
- ], Specification2.prototype, "lockedAt", void 0);
6364
6343
  __decorate([
6365
6344
  (0, typeorm_1.Column)("jsonb", {
6366
6345
  nullable: true
@@ -10352,7 +10331,7 @@ var require_skill_packs = __commonJS({
10352
10331
  {
10353
10332
  name: "spekn-spec-manager",
10354
10333
  namespace: "spekn",
10355
- description: "Manage the specification lifecycle \u2014 create, update, lock, generate, review, and refine specs.",
10334
+ description: "Manage the specification lifecycle \u2014 create, update, activate, generate, review, and refine specs.",
10356
10335
  author: "spekn",
10357
10336
  tags: [
10358
10337
  "specification",
@@ -10844,10 +10823,11 @@ var require_specification_frontmatter = __commonJS({
10844
10823
  Object.defineProperty(exports2, "__esModule", {
10845
10824
  value: true
10846
10825
  });
10847
- exports2.SpecificationFrontmatterSchema = exports2.ANCHOR_COMPLEXITIES = exports2.ANCHOR_STATUSES = exports2.ACP_POLICY_MODES = exports2.CATEGORY_TYPE_MAP = exports2.SPECIFICATION_DEPTHS = exports2.SPECIFICATION_CATEGORIES = exports2.SPECIFICATION_STATUSES = exports2.SPECIFICATION_TYPES = exports2.HINT_MAX_LENGTH = exports2.FRONTMATTER_MAX_SIZE_BYTES = void 0;
10826
+ exports2.SpecificationFrontmatterSchema = exports2.ANCHOR_COMPLEXITIES = exports2.ANCHOR_STATUSES = exports2.ACP_POLICY_MODES = exports2.CATEGORY_TYPE_MAP = exports2.SPECIFICATION_DEPTHS = exports2.SPECIFICATION_CATEGORIES = exports2.SPECIFICATION_STATUSES = exports2.SPECIFICATION_TYPES = exports2.HINT_MAX_LENGTH = exports2.FRONTMATTER_MAX_SIZE_BYTES = exports2.FRONTMATTER_MAX_TOKENS = void 0;
10848
10827
  exports2.validateFrontmatterSize = validateFrontmatterSize;
10849
10828
  var zod_1 = require("zod");
10850
- exports2.FRONTMATTER_MAX_SIZE_BYTES = 2048;
10829
+ exports2.FRONTMATTER_MAX_TOKENS = 1024;
10830
+ exports2.FRONTMATTER_MAX_SIZE_BYTES = exports2.FRONTMATTER_MAX_TOKENS * 4;
10851
10831
  exports2.HINT_MAX_LENGTH = 200;
10852
10832
  exports2.SPECIFICATION_TYPES = [
10853
10833
  "intent",
@@ -11037,7 +11017,7 @@ var require_frontmatter_parser = __commonJS({
11037
11017
  hasFrontmatter: true,
11038
11018
  autoGenerated: false,
11039
11019
  errors: [
11040
- `Frontmatter exceeds ${specification_frontmatter_1.FRONTMATTER_MAX_SIZE_BYTES} byte size limit`
11020
+ `Frontmatter exceeds ${specification_frontmatter_1.FRONTMATTER_MAX_TOKENS} token limit (${specification_frontmatter_1.FRONTMATTER_MAX_SIZE_BYTES} bytes). Trim hints and remove optional fields.`
11041
11021
  ]
11042
11022
  };
11043
11023
  }
@@ -15769,9 +15749,9 @@ var require_dist4 = __commonJS({
15769
15749
  });
15770
15750
  exports2.SystemRole = exports2.SpecificationVersion = exports2.GenerationStatus = exports2.SpecificationGeneration = exports2.SpecificationStatus = exports2.Specification = exports2.RunUsage = exports2.WorkerAgentType = exports2.RunStatus = exports2.Run = exports2.Project = exports2.OrganizationCreditLedgerEntryType = exports2.OrganizationCreditLedger = exports2.OrganizationCreditWalletStatus = exports2.OrganizationCreditWallet = exports2.OrganizationApiKey = exports2.OrgMemberRole = exports2.OrganizationPlan = exports2.Organization = exports2.OrchestrationTemplate = exports2.OrchestrationPolicy = exports2.NoteType = exports2.Note = exports2.MergeRequestStatus = exports2.MergeRequest = exports2.GitRepository = exports2.EM_ACTION_TYPES = exports2.EMActionStatus = exports2.EMActionExecutionStatus = exports2.EMActionLog = exports2.validateDecisionChains = exports2.validateRollbackChain = exports2.validateSupersessionChain = exports2.MAX_CHAIN_DEPTH = exports2.DecisionType = exports2.DecisionStatus = exports2.Decision = exports2.AiProviderType = exports2.AiProvider = exports2.ModelType = exports2.CapabilityTier = exports2.AiModel = exports2.BridgePairingCode = exports2.BridgeDeviceRepository = exports2.BridgeDeviceStatus = exports2.BridgeDevice = exports2.ACPCompatMode = exports2.AgentInstallLocation = exports2.AgentSource = exports2.AgentConfig = void 0;
15771
15751
  exports2.seedOrchestrationTemplates = exports2.MANAGED_SKILL_PACKS = exports2.seedManagedSkillPacks = exports2.SkillProposalStateMachine = exports2.ACTIVITY_EVENT_TYPE = exports2.ACTIVITY_SOURCE = exports2.ActivityEvent = exports2.ExportScopeMapping = exports2.ExportDeliveryMode = exports2.ExportArtifactRecord = exports2.GitHubDeadLetter = exports2.GitHubEvent = exports2.GitHubRepoMapping = exports2.RepositorySelection = exports2.GitHubAccountType = exports2.GitHubInstallation = exports2.PluginArtifact = exports2.SkillProposalType = exports2.SkillProposalStatus = exports2.SkillProposal = exports2.SkillTriggerType = exports2.SkillVersionStatus = exports2.SkillVersion = exports2.SkillPackStatus = exports2.SkillPack = exports2.DeviationStatus = exports2.DeviationSeverity = exports2.DeviationType = exports2.DeviationRecord = exports2.DecisionSeverity = exports2.RunDecisionType = exports2.DecisionRecord = exports2.RunReportStatus = exports2.RunReport = exports2.WorktreeStatus = exports2.Worktree = exports2.SpecificationLockStatus = exports2.WorkflowPhase = exports2.WorkflowState = exports2.WaitlistEntry = exports2.VerificationStatus = exports2.VerificationType = exports2.Verification = exports2.McpApiKey = exports2.UserApiKey = exports2.UserRole = exports2.User = exports2.TaskPriority = exports2.TaskStatus = exports2.Task = void 0;
15772
- exports2.PluginDeprecationRequestSchema = exports2.PluginInstallResponseSchema = exports2.PluginInstallRequestSchema = exports2.PluginPublishResponseSchema = exports2.PluginPublishRequestSchema = exports2.MarketplaceSearchResultSchema = exports2.MarketplaceSearchParamsSchema = exports2.MarketplaceCatalogEntrySchema = exports2.EXPORT_FORMAT_IDS = exports2.CONTEXT_LAYER_TYPES = exports2.DecisionTypeSchema = exports2.DecisionStatusTypeSchema = exports2.DecisionFetchResponseSchema = exports2.DecisionChainLinkSchema = exports2.DecisionFetchScopeSchema = exports2.ContextBundleResponseSchema = exports2.ContextBundleRequestSchema = exports2.clearPromptCache = exports2.resolveIncludes = exports2.interpolateTemplate = exports2.loadPromptTemplate = exports2.resolveSpecCategory = exports2.inferTypeFromContent = exports2.extractAnchorPaths = exports2.autoGenerateFrontmatter = exports2.serializeFrontmatter = exports2.parseSpecificationFrontmatter = exports2.CATEGORY_TYPE_MAP = exports2.SPECIFICATION_DEPTHS = exports2.SPECIFICATION_CATEGORIES = exports2.SPECIFICATION_STATUSES = exports2.SPECIFICATION_TYPES = exports2.HINT_MAX_LENGTH = exports2.FRONTMATTER_MAX_SIZE_BYTES = exports2.validateFrontmatterSize = exports2.SpecificationFrontmatterSchema = exports2.SkillProposalStatusType = exports2.SkillPackStatusType = exports2.parseLegacyFrontmatter = exports2.RESERVED_SKILL_PREFIXES = exports2.SKILL_NAME_PATTERN = exports2.SkillSearchResultSchema = exports2.SkillSearchParamsSchema = exports2.SkillLintResultSchema = exports2.SkillProposalSchema = exports2.SkillVersionSchema = exports2.SkillPackSchema = exports2.SkillFrontmatterSchemaOriginal = exports2.SkillFrontmatterSchema = exports2.DEFAULT_GOVERNANCE_POLICY = void 0;
15773
- exports2.ORG_MEMBER_LIMITS = exports2.ORG_CREATION_LIMITS = exports2.VECTOR_MEMORY_QUOTAS = exports2.FEATURE_TO_MIN_PLAN = exports2.getSatisfyingPlans = exports2.meetsMinimumTier = exports2.TIER_ORDER = exports2.hasPermissions = exports2.requirePermission = exports2.PERMISSIONS = exports2.extractUserIdentity = exports2.extractOrgRoles = exports2.decodeJwtPayload = exports2.CredentialsStore = exports2.AuthUserSchema = exports2.BRIDGE_RECONNECT_MAX_MS = exports2.BRIDGE_RECONNECT_BASE_MS = exports2.BRIDGE_HEARTBEAT_TIMEOUT_MS = exports2.BRIDGE_HEARTBEAT_INTERVAL_MS = exports2.BRIDGE_WS_PATH = exports2.emitRunStarted = exports2.emitRunFailed = exports2.emitRunCompleted = exports2.RUN_EVENTS = exports2.runEventEmitter = exports2.ensureCoreProjectSchema = exports2.resolvePgAdminClientConfig = exports2.resolvePgClientConfig = exports2.resolveDatabaseConfig = exports2.AppDataSource = exports2.DEFAULT_PLUGIN_LAYOUT = exports2.DEFAULT_MIGRATION_POLICY = exports2.DEFAULT_UPDATE_POLICY = exports2.DEFAULT_SCOPE_MAPPING = exports2.DEFAULT_NAMESPACE_POLICY = exports2.PluginRepositoryLayoutSchema = exports2.SpeknPluginManifestSchema = exports2.ClaudeCodeMarketplaceSchema = exports2.ClaudeCodeMarketplaceMetadataSchema = exports2.ClaudeCodePluginEntrySchema = exports2.ClaudeCodePluginAuthorSchema = exports2.ClaudeCodeHookMatcherSchema = exports2.ClaudeCodeHookEntrySchema = exports2.ClaudeCodePluginSourceSchema = exports2.ClaudeCodeOwnerSchema = exports2.PLUGIN_DEPRECATION_REASONS = exports2.MARKETPLACE_SORT_ORDERS = exports2.MARKETPLACE_SORT_FIELDS = exports2.MarketplaceCatalogManifestSchema = exports2.VersionCompatibilitySchema = void 0;
15774
- exports2.createCallerFactory = exports2.procedure = exports2.router = exports2.t = exports2.SpecQualityScorer = exports2.scoreSpecification = exports2.getRequiredPlan = exports2.PROJECT_CREATION_LIMITS = void 0;
15752
+ exports2.PluginInstallResponseSchema = exports2.PluginInstallRequestSchema = exports2.PluginPublishResponseSchema = exports2.PluginPublishRequestSchema = exports2.MarketplaceSearchResultSchema = exports2.MarketplaceSearchParamsSchema = exports2.MarketplaceCatalogEntrySchema = exports2.EXPORT_FORMAT_IDS = exports2.CONTEXT_LAYER_TYPES = exports2.DecisionTypeSchema = exports2.DecisionStatusTypeSchema = exports2.DecisionFetchResponseSchema = exports2.DecisionChainLinkSchema = exports2.DecisionFetchScopeSchema = exports2.ContextBundleResponseSchema = exports2.ContextBundleRequestSchema = exports2.clearPromptCache = exports2.resolveIncludes = exports2.interpolateTemplate = exports2.loadPromptTemplate = exports2.resolveSpecCategory = exports2.inferTypeFromContent = exports2.extractAnchorPaths = exports2.autoGenerateFrontmatter = exports2.serializeFrontmatter = exports2.parseSpecificationFrontmatter = exports2.CATEGORY_TYPE_MAP = exports2.SPECIFICATION_DEPTHS = exports2.SPECIFICATION_CATEGORIES = exports2.SPECIFICATION_STATUSES = exports2.SPECIFICATION_TYPES = exports2.HINT_MAX_LENGTH = exports2.FRONTMATTER_MAX_TOKENS = exports2.FRONTMATTER_MAX_SIZE_BYTES = exports2.validateFrontmatterSize = exports2.SpecificationFrontmatterSchema = exports2.SkillProposalStatusType = exports2.SkillPackStatusType = exports2.parseLegacyFrontmatter = exports2.RESERVED_SKILL_PREFIXES = exports2.SKILL_NAME_PATTERN = exports2.SkillSearchResultSchema = exports2.SkillSearchParamsSchema = exports2.SkillLintResultSchema = exports2.SkillProposalSchema = exports2.SkillVersionSchema = exports2.SkillPackSchema = exports2.SkillFrontmatterSchemaOriginal = exports2.SkillFrontmatterSchema = exports2.DEFAULT_GOVERNANCE_POLICY = void 0;
15753
+ exports2.ORG_CREATION_LIMITS = exports2.VECTOR_MEMORY_QUOTAS = exports2.FEATURE_TO_MIN_PLAN = exports2.getSatisfyingPlans = exports2.meetsMinimumTier = exports2.TIER_ORDER = exports2.hasPermissions = exports2.requirePermission = exports2.PERMISSIONS = exports2.extractUserIdentity = exports2.extractOrgRoles = exports2.decodeJwtPayload = exports2.CredentialsStore = exports2.AuthUserSchema = exports2.BRIDGE_RECONNECT_MAX_MS = exports2.BRIDGE_RECONNECT_BASE_MS = exports2.BRIDGE_HEARTBEAT_TIMEOUT_MS = exports2.BRIDGE_HEARTBEAT_INTERVAL_MS = exports2.BRIDGE_WS_PATH = exports2.emitRunStarted = exports2.emitRunFailed = exports2.emitRunCompleted = exports2.RUN_EVENTS = exports2.runEventEmitter = exports2.ensureCoreProjectSchema = exports2.resolvePgAdminClientConfig = exports2.resolvePgClientConfig = exports2.resolveDatabaseConfig = exports2.AppDataSource = exports2.DEFAULT_PLUGIN_LAYOUT = exports2.DEFAULT_MIGRATION_POLICY = exports2.DEFAULT_UPDATE_POLICY = exports2.DEFAULT_SCOPE_MAPPING = exports2.DEFAULT_NAMESPACE_POLICY = exports2.PluginRepositoryLayoutSchema = exports2.SpeknPluginManifestSchema = exports2.ClaudeCodeMarketplaceSchema = exports2.ClaudeCodeMarketplaceMetadataSchema = exports2.ClaudeCodePluginEntrySchema = exports2.ClaudeCodePluginAuthorSchema = exports2.ClaudeCodeHookMatcherSchema = exports2.ClaudeCodeHookEntrySchema = exports2.ClaudeCodePluginSourceSchema = exports2.ClaudeCodeOwnerSchema = exports2.PLUGIN_DEPRECATION_REASONS = exports2.MARKETPLACE_SORT_ORDERS = exports2.MARKETPLACE_SORT_FIELDS = exports2.MarketplaceCatalogManifestSchema = exports2.VersionCompatibilitySchema = exports2.PluginDeprecationRequestSchema = void 0;
15754
+ exports2.createCallerFactory = exports2.procedure = exports2.router = exports2.t = exports2.SpecQualityScorer = exports2.scoreSpecification = exports2.getRequiredPlan = exports2.PROJECT_CREATION_LIMITS = exports2.ORG_MEMBER_LIMITS = void 0;
15775
15755
  var AgentConfig_1 = require_AgentConfig();
15776
15756
  Object.defineProperty(exports2, "AgentConfig", {
15777
15757
  enumerable: true,
@@ -16531,6 +16511,12 @@ var require_dist4 = __commonJS({
16531
16511
  return specification_frontmatter_1.FRONTMATTER_MAX_SIZE_BYTES;
16532
16512
  }, "get")
16533
16513
  });
16514
+ Object.defineProperty(exports2, "FRONTMATTER_MAX_TOKENS", {
16515
+ enumerable: true,
16516
+ get: /* @__PURE__ */ __name(function() {
16517
+ return specification_frontmatter_1.FRONTMATTER_MAX_TOKENS;
16518
+ }, "get")
16519
+ });
16534
16520
  Object.defineProperty(exports2, "HINT_MAX_LENGTH", {
16535
16521
  enumerable: true,
16536
16522
  get: /* @__PURE__ */ __name(function() {
@@ -41240,8 +41226,7 @@ ${spec2.content}`).join("\n\n");
41240
41226
  projectId: payload.project_id,
41241
41227
  title: payload.title,
41242
41228
  content: payload.content,
41243
- status: shared_1.SpecificationStatus.DRAFT,
41244
- isLocked: false
41229
+ status: shared_1.SpecificationStatus.DRAFT
41245
41230
  });
41246
41231
  const created = await dataSource.getRepository(shared_1.Specification).save(spec2);
41247
41232
  return {
@@ -41276,11 +41261,11 @@ ${payload.content}`;
41276
41261
  });
41277
41262
  if (!specification) throw new Error("Specification not found");
41278
41263
  assertProjectScope(specification.projectId, context2.projectId);
41279
- specification.status = shared_1.SpecificationStatus.LOCKED;
41264
+ specification.status = shared_1.SpecificationStatus.ACTIVE;
41280
41265
  const saved = await dataSource.getRepository(shared_1.Specification).save(specification);
41281
41266
  return {
41282
41267
  specification_id: saved.id,
41283
- locked: true
41268
+ activated: true
41284
41269
  };
41285
41270
  }, "spec_lock"),
41286
41271
  task_create: /* @__PURE__ */ __name(async (action, context2) => {
@@ -81184,6 +81169,7 @@ function parseArgs7(args) {
81184
81169
  const parseArgs22 = command === "generate" ? args : args.slice(1);
81185
81170
  let projectId = "";
81186
81171
  let format = "";
81172
+ let platforms;
81187
81173
  let output;
81188
81174
  let anchors;
81189
81175
  let mode = "global";
@@ -81221,6 +81207,14 @@ function parseArgs7(args) {
81221
81207
  format = arg.slice("--format=".length);
81222
81208
  continue;
81223
81209
  }
81210
+ if (arg === "--platforms" && parseArgs22[index + 1]) {
81211
+ platforms = parseArgs22[++index].split(",").map((p) => p.trim()).filter(Boolean);
81212
+ continue;
81213
+ }
81214
+ if (arg.startsWith("--platforms=")) {
81215
+ platforms = arg.slice("--platforms=".length).split(",").map((p) => p.trim()).filter(Boolean);
81216
+ continue;
81217
+ }
81224
81218
  if (arg === "--output" && parseArgs22[index + 1]) {
81225
81219
  output = parseArgs22[++index];
81226
81220
  continue;
@@ -81310,7 +81304,23 @@ function parseArgs7(args) {
81310
81304
  continue;
81311
81305
  }
81312
81306
  }
81313
- if (command !== "discover" && ![
81307
+ const validPlatforms = [
81308
+ "claude-code",
81309
+ "codex",
81310
+ "gemini",
81311
+ "opencode",
81312
+ "vibe"
81313
+ ];
81314
+ if (platforms?.length) {
81315
+ if (format) {
81316
+ throw new Error("--format and --platforms are mutually exclusive");
81317
+ }
81318
+ for (const p of platforms) {
81319
+ if (!validPlatforms.includes(p)) {
81320
+ throw new Error(`Invalid platform "${p}". Allowed values: ${validPlatforms.join(", ")}`);
81321
+ }
81322
+ }
81323
+ } else if (command !== "discover" && ![
81314
81324
  "agents-md",
81315
81325
  "claude-md",
81316
81326
  "cursorrules",
@@ -81339,6 +81349,7 @@ function parseArgs7(args) {
81339
81349
  command,
81340
81350
  projectId,
81341
81351
  format,
81352
+ platforms,
81342
81353
  output,
81343
81354
  anchors,
81344
81355
  mode,
@@ -81515,7 +81526,13 @@ async function runExportCli(args, deps = defaultDeps) {
81515
81526
  }
81516
81527
  return 0;
81517
81528
  }
81518
- const plan = await client.export.delivery.previewTarget.query({
81529
+ const plan = options.platforms?.length ? await client.export.delivery.previewMultiPlatform.query({
81530
+ projectId: context2.projectId,
81531
+ platformTargets: options.platforms,
81532
+ mode: options.mode,
81533
+ scopePath: options.scope,
81534
+ anchorFilter: options.anchors
81535
+ }) : await client.export.delivery.previewTarget.query({
81519
81536
  projectId: context2.projectId,
81520
81537
  formatId: options.format,
81521
81538
  mode: options.mode,
@@ -105958,7 +105975,8 @@ var require_dist18 = __commonJS({
105958
105975
  "archived"
105959
105976
  ];
105960
105977
  var HINT_MAX_LENGTH2 = 200;
105961
- var FRONTMATTER_MAX_SIZE = 2048;
105978
+ var FRONTMATTER_MAX_TOKENS = 1024;
105979
+ var FRONTMATTER_MAX_SIZE = FRONTMATTER_MAX_TOKENS * 4;
105962
105980
  function parseFrontmatter(content) {
105963
105981
  const match = FRONTMATTER_REGEX.exec(content);
105964
105982
  if (!match) return null;
@@ -106060,7 +106078,7 @@ var require_dist18 = __commonJS({
106060
106078
  findings.push({
106061
106079
  checkId,
106062
106080
  severity: "error",
106063
- message: `Frontmatter exceeds 2KB limit (${sizeBytes} bytes): ${file.relativePath}`,
106081
+ message: `Frontmatter exceeds ${FRONTMATTER_MAX_TOKENS}-token limit (${sizeBytes} bytes): ${file.relativePath}`,
106064
106082
  file: file.relativePath,
106065
106083
  autoFixable: false,
106066
106084
  speknCta: "Spekn enforces frontmatter size limits during validation"
@@ -110712,9 +110730,9 @@ AI enhancement skipped: ${aiResult.error}
110712
110730
  });
110713
110731
  return;
110714
110732
  }
110715
- if (!body.formatId) {
110733
+ if (!body.formatId && !body.platformTargets?.length) {
110716
110734
  sendJson(res, 400, {
110717
- error: "formatId is required"
110735
+ error: "formatId or platformTargets is required"
110718
110736
  });
110719
110737
  return;
110720
110738
  }
@@ -110723,6 +110741,7 @@ AI enhancement skipped: ${aiResult.error}
110723
110741
  exportId,
110724
110742
  projectId: body.projectId,
110725
110743
  formatId: body.formatId,
110744
+ platformTargets: body.platformTargets,
110726
110745
  apiUrl: body.apiUrl ?? "http://localhost:3001",
110727
110746
  mode: body.mode,
110728
110747
  scopePath: body.scopePath,
@@ -112407,17 +112426,20 @@ AI enhancement skipped: ${aiResult.error}
112407
112426
  }
112408
112427
  }
112409
112428
  buildCliArgs(payload) {
112410
- const { projectId, formatId, mode, scopePath, anchorFilter } = payload;
112429
+ const { projectId, formatId, platformTargets, mode, scopePath, anchorFilter } = payload;
112411
112430
  const args = [
112412
112431
  "export",
112413
112432
  "--project",
112414
112433
  projectId,
112415
- "--format",
112416
- formatId,
112417
112434
  "--delivery",
112418
112435
  "download",
112419
112436
  "--json"
112420
112437
  ];
112438
+ if (platformTargets?.length) {
112439
+ args.push("--platforms", platformTargets.join(","));
112440
+ } else if (formatId) {
112441
+ args.push("--format", formatId);
112442
+ }
112421
112443
  if (mode === "scoped") {
112422
112444
  args.push("--mode", "scoped");
112423
112445
  }
@@ -115992,7 +116014,8 @@ var require_frontmatter_quality = __commonJS({
115992
116014
  "archived"
115993
116015
  ];
115994
116016
  var HINT_MAX_LENGTH2 = 200;
115995
- var FRONTMATTER_MAX_SIZE = 2048;
116017
+ var FRONTMATTER_MAX_TOKENS = 1024;
116018
+ var FRONTMATTER_MAX_SIZE = FRONTMATTER_MAX_TOKENS * 4;
115996
116019
  function parseFrontmatter(content) {
115997
116020
  const match = FRONTMATTER_REGEX.exec(content);
115998
116021
  if (!match) return null;
@@ -116090,7 +116113,7 @@ var require_frontmatter_quality = __commonJS({
116090
116113
  findings.push({
116091
116114
  checkId,
116092
116115
  severity: "error",
116093
- message: `Frontmatter exceeds 2KB limit (${sizeBytes} bytes): ${file.relativePath}`,
116116
+ message: `Frontmatter exceeds ${FRONTMATTER_MAX_TOKENS}-token limit (${sizeBytes} bytes): ${file.relativePath}`,
116094
116117
  file: file.relativePath,
116095
116118
  autoFixable: false,
116096
116119
  speknCta: "Spekn enforces frontmatter size limits during validation"
@@ -123355,7 +123378,7 @@ function registerVoidAction(command, pathSegments, runner) {
123355
123378
  });
123356
123379
  }
123357
123380
  __name(registerVoidAction, "registerVoidAction");
123358
- var cliVersion = true ? "1.0.3" : "0.0.0-dev";
123381
+ var cliVersion = true ? "1.0.5" : "0.0.0-dev";
123359
123382
  checkForUpdates(cliVersion);
123360
123383
  var program = new import_commander.Command();
123361
123384
  program.name("spekn").description("Spekn CLI \u2014 Spec-Driven Development toolchain").version(cliVersion);
@@ -42,7 +42,7 @@ RULES:
42
42
  - ALWAYS use MCP tools (spekn_spec_create / spekn_spec_update / spekn_decision_create) — never just describe what you would create
43
43
  - Every spec MUST follow the format from spekn-spec-format
44
44
  - Every spec MUST score at least B (75+) per the spekn-quality-scoring checklist
45
- - Frontmatter MUST stay under 2048 bytes — if a tool call fails with size limit, trim and retry
45
+ - Frontmatter MUST stay under ~1024 tokens (~4KB) — if a tool call fails with size limit, trim and retry
46
46
  - Minimize churn — prefer updates over new specs
47
47
  - Respect existing canonical spec set
48
48
  - If a tool call fails for other reasons, report the error and continue with the next item