airgen-cli 0.20.3 → 0.20.4

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.
@@ -139,8 +139,10 @@ export function registerRequirementCommands(program, client) {
139
139
  .option("--idempotency-key <key>", "Prevent duplicates on retry — returns existing if key was already used")
140
140
  .action(async (tenant, projectKey, opts) => {
141
141
  if (!opts.section && !opts.document) {
142
- console.error("Warning: No --section or --document specified. Requirement will be project-level with a generic ref (e.g., REQ-PROJECTNAME-001).");
143
- console.error(" Use --section <id> to assign to a document section for proper ref prefixing.");
142
+ console.error("Error: --section or --document is required. Without it, the requirement gets a project-level ref");
143
+ console.error(" (e.g., REQ-SEEMERGENCYDIESEL...-001) that breaks delete/reassign on long project slugs.");
144
+ console.error(" Use: airgen docs sections list <tenant> <project> <document> to find section IDs.");
145
+ process.exit(1);
144
146
  }
145
147
  const data = await client.post("/requirements", {
146
148
  tenant,
@@ -378,6 +380,11 @@ export function registerRequirementCommands(program, client) {
378
380
  skipped++;
379
381
  continue;
380
382
  }
383
+ if (!item.document && !item.documentSlug && !item.section && !item.sectionId) {
384
+ console.error(` [${i}] Skipped: missing document/section (would create homeless requirement)`);
385
+ skipped++;
386
+ continue;
387
+ }
381
388
  if (opts.dryRun) {
382
389
  console.log(` [dry-run] ${truncate(text, 80)}`);
383
390
  created++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airgen-cli",
3
- "version": "0.20.3",
3
+ "version": "0.20.4",
4
4
  "description": "AIRGen CLI — requirements engineering from the command line",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",