yadflow 1.0.1

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 (77) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +21 -0
  3. package/README.md +559 -0
  4. package/bin/sdlc.mjs +135 -0
  5. package/cli/commit.mjs +81 -0
  6. package/cli/epic-state.mjs +220 -0
  7. package/cli/gate.mjs +456 -0
  8. package/cli/lib.mjs +142 -0
  9. package/cli/manifest.mjs +119 -0
  10. package/cli/openpr.mjs +65 -0
  11. package/cli/plan.mjs +127 -0
  12. package/cli/platform.mjs +151 -0
  13. package/cli/reconcile.mjs +83 -0
  14. package/cli/repo.mjs +61 -0
  15. package/cli/setup.mjs +208 -0
  16. package/package.json +51 -0
  17. package/skills/sdlc/config.yaml +156 -0
  18. package/skills/sdlc/install.sh +51 -0
  19. package/skills/sdlc/module-help.csv +17 -0
  20. package/skills/sdlc-author-analysis/SKILL.md +136 -0
  21. package/skills/sdlc-author-architecture/SKILL.md +180 -0
  22. package/skills/sdlc-author-architecture/references/contract-format.md +72 -0
  23. package/skills/sdlc-author-epic/SKILL.md +154 -0
  24. package/skills/sdlc-author-epic/references/state-schema.md +187 -0
  25. package/skills/sdlc-author-stories/SKILL.md +109 -0
  26. package/skills/sdlc-author-stories/references/story-schema.md +46 -0
  27. package/skills/sdlc-author-ui/SKILL.md +113 -0
  28. package/skills/sdlc-backfill/SKILL.md +91 -0
  29. package/skills/sdlc-backfill/references/backfill.md +66 -0
  30. package/skills/sdlc-backfill/templates/checks/backfill-check.sh +42 -0
  31. package/skills/sdlc-checks/SKILL.md +138 -0
  32. package/skills/sdlc-checks/references/check-gates.md +168 -0
  33. package/skills/sdlc-checks/templates/checks/build-test-lint.sh +14 -0
  34. package/skills/sdlc-checks/templates/checks/contract-check.sh +62 -0
  35. package/skills/sdlc-checks/templates/checks/spec-link.sh +38 -0
  36. package/skills/sdlc-checks/templates/checks/verified-commits.sh +120 -0
  37. package/skills/sdlc-checks/templates/github/sdlc-checks.yml +45 -0
  38. package/skills/sdlc-checks/templates/github/sdlc-verified-commits.yml +22 -0
  39. package/skills/sdlc-checks/templates/gitlab/.gitlab-ci.yml +40 -0
  40. package/skills/sdlc-checks/templates/gitlab/gitlab-ci.include-root.yml +7 -0
  41. package/skills/sdlc-checks/templates/gitlab/sdlc-checks.gitlab-ci.yml +47 -0
  42. package/skills/sdlc-checks/templates/gitlab/sdlc-verified-commits.gitlab-ci.yml +21 -0
  43. package/skills/sdlc-connect-repos/SKILL.md +159 -0
  44. package/skills/sdlc-connect-repos/references/code-context.md +92 -0
  45. package/skills/sdlc-connect-repos/references/hub-config.md +77 -0
  46. package/skills/sdlc-connect-repos/references/repos-registry.md +62 -0
  47. package/skills/sdlc-hub-bridge/SKILL.md +119 -0
  48. package/skills/sdlc-hub-bridge/references/bridge.md +136 -0
  49. package/skills/sdlc-hub-bridge/references/login-roster.md +42 -0
  50. package/skills/sdlc-hub-bridge/templates/checks/hub-route.sh +50 -0
  51. package/skills/sdlc-hub-bridge/templates/github/sdlc-gate-sync.yml +63 -0
  52. package/skills/sdlc-hub-bridge/templates/gitlab/gitlab-ci.include-root.yml +7 -0
  53. package/skills/sdlc-hub-bridge/templates/gitlab/sdlc-gate-sync.gitlab-ci.yml +64 -0
  54. package/skills/sdlc-implement/SKILL.md +143 -0
  55. package/skills/sdlc-implement/references/implement-conventions.md +103 -0
  56. package/skills/sdlc-implement/templates/.gitmessage +17 -0
  57. package/skills/sdlc-pr-template/SKILL.md +86 -0
  58. package/skills/sdlc-pr-template/references/risk-routing.md +54 -0
  59. package/skills/sdlc-pr-template/templates/checks/risk-route.sh +44 -0
  60. package/skills/sdlc-pr-template/templates/github/pull_request_template.md +30 -0
  61. package/skills/sdlc-pr-template/templates/gitlab/merge_request_templates/Default.md +32 -0
  62. package/skills/sdlc-pr-template/templates/hub/github/pull_request_template.md +36 -0
  63. package/skills/sdlc-pr-template/templates/hub/gitlab/merge_request_templates/Default.md +37 -0
  64. package/skills/sdlc-review-comments/SKILL.md +63 -0
  65. package/skills/sdlc-review-comments/references/comment-conventions.md +55 -0
  66. package/skills/sdlc-review-comments/templates/github/REVIEW_COMMENTS.md +49 -0
  67. package/skills/sdlc-review-comments/templates/gitlab/REVIEW_COMMENTS.md +49 -0
  68. package/skills/sdlc-review-gate/SKILL.md +196 -0
  69. package/skills/sdlc-review-gate/references/gating.md +79 -0
  70. package/skills/sdlc-run/SKILL.md +109 -0
  71. package/skills/sdlc-run/references/run-loop.md +121 -0
  72. package/skills/sdlc-ship/SKILL.md +86 -0
  73. package/skills/sdlc-ship/references/ship-and-record.md +67 -0
  74. package/skills/sdlc-ship/templates/.coderabbit.yaml +19 -0
  75. package/skills/sdlc-spec/SKILL.md +119 -0
  76. package/skills/sdlc-spec/references/spec-handoff.md +101 -0
  77. package/skills/sdlc-status/SKILL.md +92 -0
@@ -0,0 +1,101 @@
1
+ # Spec Kit handoff — command list, output map, and degradation rules
2
+
3
+ Step A (`sdlc-spec`) runs the **heavy Spec Kit ceremony once per story per repo** and writes the
4
+ result into the story's code repo. This reference pins the exact commands, the files they produce, and
5
+ how to hand-author the same files faithfully when Spec Kit is not installed — so Step B
6
+ (`sdlc-implement`, not built yet) can read them unchanged.
7
+
8
+ ## The ceremony (run once, in order)
9
+
10
+ Driven as harness slash-commands (RESEARCH-NOTES §2, Deviation 3), from **inside** the code repo:
11
+
12
+ | # | Command | Purpose | Writes |
13
+ |---|---------|---------|--------|
14
+ | 1 | `/speckit.specify` | Turn the story into a spec | `specs/<feature-id>/spec.md` (+ `research.md`, `data-model.md`, `contracts/`) |
15
+ | 2 | `/speckit.clarify` | Resolve ambiguities; tighten the spec | updates `spec.md` |
16
+ | 3 | `/speckit.plan` | Technical approach for this repo | `specs/<feature-id>/plan.md` |
17
+ | 4 | `/speckit.analyze` | Cross-check spec ↔ plan consistency | updates `spec.md`/`plan.md` |
18
+ | 5 | `/speckit.checklist` | Quality checklist for the spec | checklist section under `specs/<feature-id>/` (in the degraded path, folded into `spec.md`) |
19
+ | 6 | `/speckit.tasks` | Atomic task list | `specs/<feature-id>/tasks.md` |
20
+
21
+ **Excluded from Step A:** `/speckit.constitution` (project-level, one-time bootstrap) and
22
+ `/speckit.implement` (that is Step B — the per-task build loop). Stop at `tasks`.
23
+
24
+ **Feature-id is pinned** to the story ID (`EP-<slug>-S0N`), never Spec Kit's numbered auto-slug. If a
25
+ Spec Kit version forces its own folder name, keep the run but make `link.md` (below) the crosswalk
26
+ between the Spec-Kit slug and the permanent story ID.
27
+
28
+ ## Output map (what must exist after Step A)
29
+
30
+ ```
31
+ demo-repos/<repo>/specs/<story-id>/
32
+ spec.md # the feature spec — what to build & why, traced to acceptance criteria
33
+ research.md # decisions/unknowns resolved during clarify
34
+ data-model.md # entities/fields THIS repo implements (quoting the shared ones from the contract)
35
+ contracts/ # the API/event surface this repo implements (quoted from the locked contract)
36
+ plan.md # technical approach for this repo
37
+ tasks.md # numbered atomic tasks (T01…), each scoped to the files it may touch
38
+ link.md # back-pointer to the story in the product repo (Step A adds this; not a Spec Kit file)
39
+ ```
40
+
41
+ ## Degradation rules (when Spec Kit is not installed)
42
+
43
+ Author each file by hand so it is **indistinguishable in shape** from a real Spec Kit run. The content
44
+ comes from the story's acceptance criteria and the **locked contract surface** — never invented.
45
+
46
+ - **`spec.md`** — restate the story as a spec: context, the user/system need, in-scope behavior,
47
+ out-of-scope, and acceptance criteria copied verbatim from the story. Reference (do not redefine) the
48
+ contract endpoints/entities the story touches.
49
+ - **`research.md`** — list the decisions and any unknowns; if the story is unambiguous, say so. Note
50
+ where the contract already settles a question (e.g. status is server-owned).
51
+ - **`data-model.md`** — the entities/fields **this repo** implements. Shared entities (e.g. `Inquiry`,
52
+ `InquiryStatus`) are **quoted from the contract** and marked as contract-owned; repo-private fields
53
+ are marked as local.
54
+ - **`contracts/`** — the slice of the API/event surface this repo implements, **quoted from the locked
55
+ `contract.md`** (e.g. `POST /inquiries` request/response). Add a one-line note that this is a quote of
56
+ the locked surface, not a new definition.
57
+ - **`plan.md`** — the technical approach for this repo at story altitude (components, sequence,
58
+ test approach). No new cross-repo surface.
59
+ - **`tasks.md`** — numbered atomic tasks. Each task: an ID (`T01`, `T02`, …), a one-line goal, and an
60
+ explicit **Files** list naming the files it may touch (≤3 where possible). This is what Step B reads
61
+ to enforce "the diff stays inside the files the task declared."
62
+
63
+ ## link.md template
64
+
65
+ ```markdown
66
+ ---
67
+ story: EP-<slug>-S0N
68
+ epic: EP-<slug>
69
+ repo: <repo>
70
+ feature-id: EP-<slug>-S0N
71
+ product-repo: <absolute or relative path to the product repo>
72
+ contract-lock: sha256:<hex copied from epics/EP-<slug>/.sdlc/contract-lock.json>
73
+ speckit: installed | not-installed
74
+ generated: <YYYY-MM-DD>
75
+ ---
76
+
77
+ # Spec link — EP-<slug>-S0N (<repo>)
78
+
79
+ This spec implements story **EP-<slug>-S0N** of epic **EP-<slug>** for the **<repo>** repo.
80
+
81
+ - Story: `<product-repo>/epics/EP-<slug>/stories/EP-<slug>-S0N.md`
82
+ - Contract (locked, singular): `<product-repo>/epics/EP-<slug>/contract.md`
83
+ - Contract surface hash at spec time: `sha256:<hex>` (copied from the lock, not recomputed here)
84
+
85
+ The contract surface above is **referenced, not re-defined**. Any change to the shared surface must go
86
+ back to the architecture gate in the product repo — it is never widened from this code repo.
87
+ ```
88
+
89
+ ## Do not re-invent the contract
90
+
91
+ The spec **quotes** the locked surface; it never extends it. To confirm the surface the spec relies on
92
+ matches the lock, run from the **product** repo:
93
+
94
+ ```bash
95
+ awk '/CONTRACT-SURFACE:BEGIN/{f=1;next} /CONTRACT-SURFACE:END/{f=0} f' \
96
+ epics/EP-<slug>/contract.md | shasum -a 256
97
+ # compare against epics/EP-<slug>/.sdlc/contract-lock.json
98
+ ```
99
+
100
+ If the story needs surface that is not in the locked block, STOP and route back to the architecture
101
+ gate. Step A never re-locks or widens the contract.
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: sdlc-status
3
+ description: 'Read-only view of an SDLC epic: prints the current step, each step''s dials (assistance/automation) and status, and which approvals are still required at the active gate. For stories in the build half it also prints each back-half step''s automation dial, status, and trust record (runs / % approved-unchanged / whether it clears the threshold to be earned), plus the system-wide kill-switch state — so the team can see WHY a step is automated and reverse it with evidence. Surfaces the Phase 5 instrumentation signals: per-step "earned but manual" (nudge cost) and, across multiple epics, a fleet roll-up (scale of read). Use when the user says "sdlc status", "where is epic EP-...", "what is blocking the gate", "show the trust record", or "fleet status".'
4
+ ---
5
+
6
+ # SDLC — Status (read-only)
7
+
8
+ **Goal:** Make the file-driven state legible at a glance. This skill **never writes** — it only
9
+ reads `.sdlc/` and `reviews/` and reports.
10
+
11
+ ## Conventions
12
+ - `{project-root}` resolves from the project working directory.
13
+ - Operate on one epic: `{project-root}/epics/EP-<slug>/`.
14
+
15
+ ## On Activation
16
+
17
+ ### Step 1 — Resolve the epic
18
+ If no `EP-<slug>` was given, list the epics under `{project-root}/epics/` and ask which one (or
19
+ report all if the user asked for an overview).
20
+
21
+ ### Step 2 — Read state
22
+ Read `.sdlc/state.json`, `.sdlc/approvals.json`, `epic.md` frontmatter (for `repos`), and — if present
23
+ — `.sdlc/contract-lock.json`. For the build half (Phase 4), also read — if present — every
24
+ `.sdlc/build-state/<story-id>.json`, `.sdlc/trust-log.json`, and the `automation` block of
25
+ `skills/sdlc/config.yaml` (`back_steps`, `trust_threshold`, `locked_steps`, `kill_switch`). Do not
26
+ modify any of them.
27
+
28
+ ### Step 3 — Report
29
+ Print, in this order:
30
+
31
+ 1. **Epic:** `epicId`, `status` from `epic.md` frontmatter, `currentStep`, and `repos` (the touched
32
+ domains).
33
+ 2. **Steps table** — for every front step in `steps[]` order (8, or 10 when the optional analysis step
34
+ was run): `id`, `type`, `status`, `assistance`, `automation`, `locked`, and `risk_tags`. Mark the
35
+ `currentStep` with `→`. The full front-state chain is `[analysis → analysis-review →] epic →
36
+ epic-review → architecture → architecture-review → ui-design → ui-design-review → stories →
37
+ stories-review` (then `ready-for-build`); the bracketed `analysis` prefix is present only when
38
+ `sdlc-author-analysis` seeded it. Always render exactly the steps present in `steps[]`.
39
+ 3. **Active gate** — for the `currentStep` (if it is a `review+approve` step), compute and show:
40
+ - the reviewer rule in force — **base** (`owner + 1 reviewer`), **escalated** (list the required
41
+ domains), or **per-repo** for `stories-review` (list each repo needing sign-off),
42
+ - approvals **recorded so far** (from `approvals.json`), and
43
+ - approvals **still required** to pass the gate (name the missing domains/repos).
44
+ Do not advance — just state whether the gate would pass right now.
45
+
46
+ Apply the same predicate `sdlc-review-gate` uses (restated here so this skill is
47
+ self-contained). From the `approved` records in `approvals.json` for the current step:
48
+ - `owners` = records with `role == "owner"`; `reviewers` = distinct `role == "reviewer"`;
49
+ `domainOwners` = `role == "domain-owner"`, grouped by `domain`.
50
+ - **Base pass:** `|owners| >= 1` AND `|reviewers| >= 1` (the configured `default_reviewers`).
51
+ - **Escalated pass** (step `risk_tags` ∩ `{contract, auth, payments}` ≠ ∅): base pass AND, for
52
+ every touched domain, `|domainOwners[domain]| >= 1`. Touched domains = `epic.repos` for
53
+ `architecture-review`; the union of every story's `repos` for `stories-review`.
54
+ - Approvals are **stale** (gate fails) if the artifact was edited after the newest `approved`
55
+ record. For `architecture-review`, also flag staleness if the contract-surface hash no longer
56
+ matches `.sdlc/contract-lock.json`.
57
+ 4. **Contract lock** — if `.sdlc/contract-lock.json` exists, show the locked hash and `lockedAt`
58
+ (and, when at/after `architecture-review`, whether the current surface still matches it).
59
+ 5. **Stories** — if `stories/` has files, list each story `id` and its `repos` tags.
60
+ 6. **Files** — list the review records present under `reviews/` for the current artifact.
61
+ 7. **Build half (per story, per repo)** — if any `.sdlc/build-state/<story-id>.json` exists, then for
62
+ each such story and each of its repos print the back-half chain
63
+ `spec → tasks → implement → checks → engineer-review`, marking each step's `status`, its
64
+ `automation` dial, and `locked`. Mark that repo's `currentStep` with `→`. This shows, at a glance,
65
+ which back steps are automated and where a run is waiting.
66
+ 8. **Automation & trust** — print the system-wide **kill switch** state from `config.yaml`
67
+ `automation.kill_switch` (when `on`, note that every step is forced to `human_approve`). Then, for
68
+ each back-half step that has entries in `.sdlc/trust-log.json`, print its **trust record**: number
69
+ of runs, the fraction with `verdict == "approved-unchanged"`, and whether that clears
70
+ `automation.trust_threshold` (`min_runs`, `min_approved_unchanged`) — i.e. whether the step is
71
+ **earned** (eligible to be flipped to `machine_advance`) or still **gathering evidence**. Restate
72
+ the predicate (self-contained): `earned = runs >= min_runs AND unchanged/runs >= min_approved_unchanged`.
73
+ Never recommend flipping a locked step or a front state — those can never be `machine_advance`.
74
+
75
+ **Nudge-cost signal (Phase 5 instrumentation).** For each back step that is **earned but its dial
76
+ is still `human_approve`** (and it is not locked / not a front state), flag it:
77
+ `⚠ earned but manual — could be machine_advance`. This is the *nudge cost* the Phase 5 trigger
78
+ watches: automation that is proven safe but still hand-started. It is a read-only observation, not a
79
+ recommendation to flip — earning the evidence and flipping the dial stay deliberate human acts
80
+ (`sdlc-run action: set-dial`). See `docs/phase-5-build-plan.md` §"What to instrument now".
81
+
82
+ 9. **Fleet roll-up (overview only).** When the user asked for an overview, or more than one epic exists
83
+ under `{project-root}/epics/`, print a one-line-per-epic roll-up across the fleet: each epic's
84
+ `currentStep` (front gate) and, for stories in the build half, a count of back-half steps **waiting
85
+ at a human gate** and of steps flagged **earned-but-manual**. Close with fleet totals (epics at each
86
+ front gate; total earned-but-manual back steps). This is the *scale-of-read* signal the Phase 5
87
+ trigger watches — when this roll-up stops fitting in one glance, that is the measured bottleneck.
88
+ Still strictly read-only; it only scans the per-epic files.
89
+
90
+ ### Hard rule
91
+ This skill is strictly read-only. If the user wants to comment, approve, or advance, point them to
92
+ `sdlc-review-gate`.