sdd-cli 0.1.21 → 0.1.22

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/README.md CHANGED
@@ -14,6 +14,8 @@ Mission and vision live in `docs/MISSION.md` and `docs/VISION.md`.
14
14
 
15
15
  Start with `docs/INDEX.md` for a full documentation map and `docs/STYLE.md` for formatting guidance.
16
16
  Contributing guidelines live in `docs/CONTRIBUTING.md`.
17
+ Contributor quickstart lives in `docs/CONTRIBUTOR_QUICKSTART.md`.
18
+ Issue triage taxonomy lives in `docs/ISSUE_TRIAGE_PLAYBOOK.md`.
17
19
  Use the PR template in `.github/PULL_REQUEST_TEMPLATE.md`.
18
20
  Maintenance guidance lives in `docs/MAINTENANCE.md`.
19
21
  Install troubleshooting lives in `docs/TROUBLESHOOTING.md`.
@@ -168,6 +170,7 @@ Use `--questions` when you want the manual question-by-question flow.
168
170
  ### Imports
169
171
  - `sdd-cli import issue <github-issue-url>` -- import issue context and bootstrap autopilot
170
172
  - `sdd-cli import jira <ticket-or-browse-url>` -- import Jira context and bootstrap autopilot
173
+ - `sdd-cli import linear <ticket-or-issue-url>` -- import Linear context and bootstrap autopilot
171
174
 
172
175
  ### Requirement lifecycle
173
176
  - `sdd-cli req create`
@@ -253,6 +256,7 @@ For a full onboarding walkthrough, see:
253
256
  - 90-day roadmap: `docs/ADOPTION_ROADMAP_90D.md`
254
257
  - Value backlog: `docs/VALUE_BACKLOG.md`
255
258
  - Error codes and remediation guide: `docs/ERROR_CODES.md`
259
+ - Integration adapters roadmap and contract: `docs/INTEGRATION_ADAPTERS.md`
256
260
 
257
261
  ## Where files are stored (clean repos)
258
262
 
@@ -275,6 +279,10 @@ Optional:
275
279
  `npm run release:notes -- --write --version v0.1.20`
276
280
  - Generate post-release quality summary:
277
281
  `npm run release:metrics`
282
+ - Run fast contributor smoke checks:
283
+ `npm run dev:smoke`
284
+ - Run contributor pre-PR release checks:
285
+ `npm run dev:release-check`
278
286
  - Promote `Unreleased` changelog entries into a version:
279
287
  `npm run release:changelog -- --version v0.1.20`
280
288
  - Verify tag/version consistency:
package/dist/cli.js CHANGED
@@ -48,6 +48,7 @@ const quickstart_1 = require("./commands/quickstart");
48
48
  const status_1 = require("./commands/status");
49
49
  const import_issue_1 = require("./commands/import-issue");
50
50
  const import_jira_1 = require("./commands/import-jira");
51
+ const import_linear_1 = require("./commands/import-linear");
51
52
  const paths_1 = require("./paths");
52
53
  const flags_1 = require("./context/flags");
53
54
  const prompt_1 = require("./ui/prompt");
@@ -398,4 +399,11 @@ importCmd
398
399
  .action(async (ticket) => {
399
400
  await (0, import_jira_1.runImportJira)(ticket);
400
401
  });
402
+ importCmd
403
+ .command("linear")
404
+ .description("Import a Linear ticket and bootstrap autopilot")
405
+ .argument("<ticket>", "Linear ticket key or issue URL")
406
+ .action(async (ticket) => {
407
+ await (0, import_linear_1.runImportLinear)(ticket);
408
+ });
401
409
  program.parse(process.argv);
@@ -0,0 +1 @@
1
+ export declare function runImportLinear(ticketInput: string): Promise<void>;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runImportLinear = runImportLinear;
4
+ const hello_1 = require("./hello");
5
+ const errors_1 = require("../errors");
6
+ function parseLinearTicket(input) {
7
+ const trimmed = input.trim();
8
+ if (!trimmed) {
9
+ return null;
10
+ }
11
+ const keyOnly = trimmed.match(/^([a-z][a-z0-9_]*-\d+)$/i);
12
+ if (keyOnly) {
13
+ return { identifier: keyOnly[1].toUpperCase() };
14
+ }
15
+ const linearUrl = trimmed.match(/^https?:\/\/linear\.app\/[^/]+\/issue\/([a-z][a-z0-9_]*-\d+)(?:[/?#].*)?$/i);
16
+ if (linearUrl) {
17
+ return { identifier: linearUrl[1].toUpperCase() };
18
+ }
19
+ return null;
20
+ }
21
+ async function fetchLinearTicket(ref) {
22
+ const endpoint = (process.env.SDD_LINEAR_API_BASE || "https://api.linear.app/graphql").trim();
23
+ const token = (process.env.SDD_LINEAR_API_KEY || "").trim();
24
+ const query = `
25
+ query IssueByIdentifier($identifier: String!) {
26
+ issue(identifier: $identifier) {
27
+ identifier
28
+ title
29
+ description
30
+ url
31
+ }
32
+ }
33
+ `;
34
+ const headers = {
35
+ "Content-Type": "application/json",
36
+ Accept: "application/json",
37
+ "User-Agent": "sdd-cli"
38
+ };
39
+ if (token.length > 0) {
40
+ headers.Authorization = token.startsWith("Bearer ") ? token : `Bearer ${token}`;
41
+ }
42
+ const response = await fetch(endpoint, {
43
+ method: "POST",
44
+ headers,
45
+ body: JSON.stringify({
46
+ query,
47
+ variables: { identifier: ref.identifier }
48
+ })
49
+ });
50
+ if (!response.ok) {
51
+ throw new Error(`Failed to fetch Linear ticket (${response.status}).`);
52
+ }
53
+ const payload = (await response.json());
54
+ if (payload.errors && payload.errors.length > 0) {
55
+ const message = payload.errors[0]?.message || "Unknown Linear API error.";
56
+ throw new Error(`Linear API error: ${message}`);
57
+ }
58
+ const issue = payload.data?.issue;
59
+ if (!issue) {
60
+ throw new Error(`Linear ticket not found: ${ref.identifier}`);
61
+ }
62
+ return {
63
+ identifier: (issue.identifier || ref.identifier).toUpperCase(),
64
+ title: issue.title?.trim() || `Linear ticket ${ref.identifier.toUpperCase()}`,
65
+ description: issue.description?.trim() || "",
66
+ sourceUrl: issue.url?.trim() || `https://linear.app/issue/${ref.identifier.toUpperCase()}`
67
+ };
68
+ }
69
+ function buildSeedText(ticket) {
70
+ const bodySnippet = ticket.description.trim().slice(0, 400).replace(/\s+/g, " ");
71
+ return `Resolve Linear ticket: ${ticket.identifier} ${ticket.title}. Context: ${bodySnippet}. Source: ${ticket.sourceUrl}`;
72
+ }
73
+ async function runImportLinear(ticketInput) {
74
+ const ref = parseLinearTicket(ticketInput);
75
+ if (!ref) {
76
+ (0, errors_1.printError)("SDD-1121", "Invalid Linear ticket. Expected LIN-123 or https://linear.app/<team>/issue/LIN-123/<slug>");
77
+ return;
78
+ }
79
+ console.log(`Importing Linear ticket ${ref.identifier} ...`);
80
+ try {
81
+ const ticket = await fetchLinearTicket(ref);
82
+ console.log(`Imported: ${ticket.title}`);
83
+ await (0, hello_1.runHello)(buildSeedText(ticket), false);
84
+ }
85
+ catch (error) {
86
+ (0, errors_1.printError)("SDD-1122", error.message);
87
+ }
88
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdd-cli",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Use sdd-cli to turn ideas, GitHub/Jira work items, and PR feedback into actionable requirements, specs, plans, and done-ready delivery records with guided workflows.",
5
5
  "keywords": [
6
6
  "cli",
@@ -42,6 +42,8 @@
42
42
  "build": "tsc -p tsconfig.json",
43
43
  "start": "node dist/cli.js",
44
44
  "dev": "ts-node src/cli.ts",
45
+ "dev:smoke": "npm run build && npm run smoke:autopilot",
46
+ "dev:release-check": "npm run check:error-codes && npm run check:docs && npm test && npm run verify:publish",
45
47
  "check:docs": "node scripts/check-docs-flags.js",
46
48
  "check:error-codes": "node scripts/check-error-codes.js",
47
49
  "release:notes": "node scripts/generate-release-notes.js",