@metasession.co/devaudit-cli 0.1.0 → 0.1.2

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 (70) hide show
  1. package/README.md +23 -11
  2. package/dist/index.js +21 -5
  3. package/dist/index.js.map +1 -1
  4. package/package.json +9 -5
  5. package/scripts/upload-evidence.sh +225 -0
  6. package/sdlc/.claude/settings.local.json +11 -0
  7. package/sdlc/CLAUDE.md +73 -0
  8. package/sdlc/HOST_ADAPTER.md +127 -0
  9. package/sdlc/SKILLS.md +137 -0
  10. package/sdlc/STACK_ADAPTER.md +130 -0
  11. package/sdlc/ai-rules/INSTRUCTIONS-SDLC.md +172 -0
  12. package/sdlc/ai-rules/README.md +103 -0
  13. package/sdlc/ai-rules/SDLC_RULES.md +584 -0
  14. package/sdlc/ai-rules/claude/CLAUDE.md +192 -0
  15. package/sdlc/ai-rules/cursor/.cursorrules +167 -0
  16. package/sdlc/ai-rules/windsurf/.windsurfrules +167 -0
  17. package/sdlc/article.md +219 -0
  18. package/sdlc/files/_common/0-project-setup.md +410 -0
  19. package/sdlc/files/_common/1-plan-requirement.md +381 -0
  20. package/sdlc/files/_common/2-implement-and-test.md +276 -0
  21. package/sdlc/files/_common/3-compile-evidence.md +603 -0
  22. package/sdlc/files/_common/4-submit-for-review.md +362 -0
  23. package/sdlc/files/_common/5-deploy-main.md +251 -0
  24. package/sdlc/files/_common/Periodic_Security_Review_Schedule.md +169 -0
  25. package/sdlc/files/_common/README_TEMPLATE.md +441 -0
  26. package/sdlc/files/_common/Test_Architecture.md +461 -0
  27. package/sdlc/files/_common/Test_Plan_TEMPLATE.md +311 -0
  28. package/sdlc/files/_common/Test_Policy.md +277 -0
  29. package/sdlc/files/_common/Test_Strategy.md +359 -0
  30. package/sdlc/files/_common/github/ISSUE_TEMPLATE/bug.yml +75 -0
  31. package/sdlc/files/_common/github/ISSUE_TEMPLATE/config.yml +11 -0
  32. package/sdlc/files/_common/github/ISSUE_TEMPLATE/requirement.yml +75 -0
  33. package/sdlc/files/_common/github/ISSUE_TEMPLATE/task.yml +48 -0
  34. package/sdlc/files/_common/github/pull_request_template.md +69 -0
  35. package/sdlc/files/_common/implementing-an-sdlc-issue.md +413 -0
  36. package/sdlc/files/_common/scripts/derive-release-version.sh +40 -0
  37. package/sdlc/files/_common/scripts/derive-release-version.test.sh +98 -0
  38. package/sdlc/files/_common/scripts/submit-for-uat-review.sh +162 -0
  39. package/sdlc/files/_common/scripts/validate-commits.sh +83 -0
  40. package/sdlc/files/_common/scripts/validate-compliance-artifacts.sh +202 -0
  41. package/sdlc/files/_common/scripts/validate-compliance-artifacts.test.sh +202 -0
  42. package/sdlc/files/_common/skills/_schema/skill.schema.json +36 -0
  43. package/sdlc/files/_common/skills/e2e-test-engineer/SKILL.md +254 -0
  44. package/sdlc/files/_common/skills/e2e-test-engineer/references/bootstrap.md +244 -0
  45. package/sdlc/files/_common/skills/e2e-test-engineer/references/evidence.ts +40 -0
  46. package/sdlc/files/_common/skills/sdlc-implementer/SKILL.md +189 -0
  47. package/sdlc/files/_common/skills/sdlc-implementer/references/call-graph.md +64 -0
  48. package/sdlc/files/_common/skills/sdlc-implementer/references/change-request-loop.md +192 -0
  49. package/sdlc/files/_common/skills/sdlc-implementer/references/compliance-constraints.md +81 -0
  50. package/sdlc/files/ci/check-release-approval.yml.template +201 -0
  51. package/sdlc/files/ci/ci-status-fallback.yml.template +41 -0
  52. package/sdlc/files/ci/ci.yml.template +390 -0
  53. package/sdlc/files/ci/compliance-evidence.yml.template +161 -0
  54. package/sdlc/files/ci/compliance-validation.yml.template +34 -0
  55. package/sdlc/files/ci/post-deploy-prod.yml.template +159 -0
  56. package/sdlc/files/ci/python/ci.yml.template +335 -0
  57. package/sdlc/files/hosts/_schema/adapter.schema.json +103 -0
  58. package/sdlc/files/hosts/railway/adapter.json +32 -0
  59. package/sdlc/files/sdlc-config.example.json +74 -0
  60. package/sdlc/files/stacks/_schema/adapter.schema.json +151 -0
  61. package/sdlc/files/stacks/node/adapter.json +54 -0
  62. package/sdlc/files/stacks/node/hooks/.prettierrc.json +9 -0
  63. package/sdlc/files/stacks/node/hooks/commit-msg +7 -0
  64. package/sdlc/files/stacks/node/hooks/commitlint.config.mjs +64 -0
  65. package/sdlc/files/stacks/node/hooks/lint-staged.config.mjs +16 -0
  66. package/sdlc/files/stacks/node/hooks/pre-commit +13 -0
  67. package/sdlc/files/stacks/node/hooks/pre-push +15 -0
  68. package/sdlc/files/stacks/node/scripts/check-requirement-jsdoc.sh +54 -0
  69. package/sdlc/files/stacks/python/adapter.json +36 -0
  70. package/sdlc/files/stacks/python/hooks/.pre-commit-config.yaml +51 -0
package/README.md CHANGED
@@ -4,30 +4,42 @@
4
4
 
5
5
  This is the source of `@metasession.co/devaudit-cli` (binary name: `devaudit`). It is under active development — see [tracking issue #1](https://github.com/metasession-dev/DevAudit-Installer/issues/1) and the full design in [`../docs/devaudit-cli/`](../docs/devaudit-cli/).
6
6
 
7
- ## Status — v0.0.1
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @metasession.co/devaudit-cli
11
+ devaudit --help
12
+ ```
13
+
14
+ Requires Node ≥ 22. Native binaries (no Node runtime needed) are on the roadmap.
15
+
16
+ ## Status — v0.1.1
8
17
 
9
18
  ### Working
10
19
 
11
20
  - `devaudit --help` / `--version`
12
21
  - `devaudit doctor` — checks `node` (>=22), `git`, `gh`, `jq`, `curl` are on PATH
13
22
  - `devaudit status [path]` — reads `sdlc-config.json` from a consumer project, prints stack/host/slug/source-dirs, and reports which framework files are present
23
+ - `devaudit install [path]` — **native TS, 11-step interactive onboarding** under `src/install/` (auth-probe → detect-stack → prompts → write-config → project → api-key → github → hooks-bootstrap → branch-protection → sync-templates → done-report). Replaces the former `scripts/sdlc-onboard.sh` (removed); no shell-out.
24
+ - `devaudit update <version> <paths...>` — **native TS, multi-project template sync** under `src/update/`. Reads each consumer's `sdlc-config.json`, copies framework files, fires `beforeSync` / `afterSync` plugin hooks. Replaces the former `scripts/sync-sdlc.sh` (removed); no shell-out.
25
+ - `devaudit push <slug> <req-id> <type> <file>` — uploads evidence to the portal (port of `upload-evidence.sh`; file or directory; retries on 429/5xx with backoff)
14
26
  - `devaudit auth login` — interactive PAT paste flow; validates against the portal; stores at `~/.config/devaudit/auth.json` (mode 0600)
15
27
  - `devaudit auth logout` — wipes the cached token
16
28
  - `devaudit auth status` — verifies the cached token (or `DEVAUDIT_USER_TOKEN` env var) by calling `GET /api/projects`
17
- - `devaudit push <slug> <req-id> <type> <file>` uploads evidence to the portal (port of `upload-evidence.sh`; file or directory; retries on 429/5xx with backoff)
18
- - `devaudit install [path]`**v0 wrapper** that shells out to `scripts/sdlc-onboard.sh`. Native TS port is workstream A milestone 3.
19
- - `devaudit update <version> <paths...>`**v0 wrapper** that shells out to `scripts/sync-sdlc.sh`. Native TS port is workstream A milestone 4.
29
+ - `devaudit plugin list`discovers plugins in `~/.config/devaudit/plugins/`, validates manifests, reports load state
30
+ - `devaudit plugin install <source>`npm-name or Git URL; clones / installs / validates / registers
31
+ - `devaudit plugin remove <name>`deregisters and rm-rfs the plugin directory
32
+ - `devaudit plugin update` — git-pulls each plugin directory
20
33
 
21
- 7 vitest tests; all green.
34
+ 40 vitest tests across 8 test files; all green on Linux + macOS + Windows.
22
35
 
23
36
  ### Stubbed (exit code 1 + helpful pointer)
24
37
 
25
- These need workstream B (portal-side) prereqs or workstream D (plugin SDK) before they can do anything real:
38
+ These need workstream B (portal-side) prereqs before they can do anything real:
26
39
 
27
- - `devaudit org list / switch / policy list|apply / report`
28
- - `devaudit plugin list / install / remove / update`
29
- - `devaudit config get / set / list`
30
- - `devaudit upgrade` (self-update — needs distribution channel established first)
40
+ - `devaudit org list / switch / policy list|apply / report` — needs portal RBAC + org endpoints
41
+ - `devaudit config get / set / list` config file already exists, just no CLI surface yet
42
+ - `devaudit upgrade` self-update; needs distribution channel established first (Step 2 of trajectory — native binaries via brew/scoop/curl)
31
43
 
32
44
  ## Develop locally
33
45
 
@@ -61,7 +73,7 @@ cli/
61
73
 
62
74
  Future structure (per [build-plan.md](../docs/devaudit-cli/build-plan.md)): `src/commands/{install,update,push,auth/*,org/*,plugin/*,config/*,status,upgrade}.ts` and `src/lib/{adapter,devaudit-api,sdlc-config,auth,git-provider,policy,plugin,report,prompts,paths,stack-detect}.ts`.
63
75
 
64
- ## Why a CLI when the bash scripts exist?
76
+ ## Why a CLI (it replaced the original bash scripts)
65
77
 
66
78
  - Cross-platform native (Linux/macOS/Windows; no WSL requirement)
67
79
  - JSON output mode on every command for CI
package/dist/index.js CHANGED
@@ -52,8 +52,12 @@ function emitJsonResult(payload) {
52
52
  process.stdout.write(JSON.stringify(payload) + "\n");
53
53
  }
54
54
 
55
+ // package.json
56
+ var package_default = {
57
+ version: "0.1.2"};
58
+
55
59
  // src/lib/version.ts
56
- var CLI_VERSION = "0.0.1";
60
+ var CLI_VERSION = package_default.version;
57
61
  var paths = envPaths("devaudit", { suffix: "" });
58
62
  var CONFIG_DIR = paths.config;
59
63
  var AUTH_FILE = join(CONFIG_DIR, "auth.json");
@@ -528,7 +532,7 @@ async function runStatus(options) {
528
532
  if (missingFiles.length === 0) {
529
533
  log.success("All checked framework files are present.");
530
534
  } else {
531
- log.warn(`${missingFiles.length} framework file(s) missing. Re-sync via DevAudit-Installer's sync-sdlc.sh to refresh.`);
535
+ log.warn(`${missingFiles.length} framework file(s) missing. Re-sync with \`devaudit update <version> <path>\` to refresh.`);
532
536
  }
533
537
  }
534
538
  var RETRYABLE_STATUSES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
@@ -704,9 +708,21 @@ async function resolveInstallerRoot() {
704
708
  const override = process.env["DEVAUDIT_INSTALLER_ROOT"];
705
709
  if (override) return resolve(override);
706
710
  const here = dirname(fileURLToPath(import.meta.url));
707
- const candidate = resolve(here, "..", "..");
708
- await promises.access(resolve(candidate, "scripts", "sdlc-onboard.sh"));
709
- return candidate;
711
+ const candidates = [resolve(here, ".."), resolve(here, "..", "..")];
712
+ for (const candidate of candidates) {
713
+ if (await hasTemplates(candidate)) return candidate;
714
+ }
715
+ throw new Error(
716
+ "Could not locate the SDLC templates (sdlc/files). Reinstall @metasession.co/devaudit-cli, or set DEVAUDIT_INSTALLER_ROOT to a DevAudit-Installer checkout."
717
+ );
718
+ }
719
+ async function hasTemplates(root) {
720
+ try {
721
+ await promises.access(resolve(root, "sdlc", "files"));
722
+ return true;
723
+ } catch {
724
+ return false;
725
+ }
710
726
  }
711
727
  async function ensureDir(dir, mode = 493) {
712
728
  await promises.mkdir(dir, { recursive: true, mode });