ai-dev-cli 2.0.0 → 2.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.
package/README.md CHANGED
@@ -17,7 +17,7 @@ npx ai-dev-cli init
17
17
  | 0 — Minimal | `CLAUDE.md` + `.claude/settings.json` (permissions) |
18
18
  | 1 — Commands | + `/plan` `/review` `/commit` custom commands |
19
19
  | 2 — Quality | + Hook scripts (bash firewall, format guard, size guard, dep guard) |
20
- | 3 — Full | + MCP config, coding standards skill, approved-deps, ADR directory |
20
+ | 3 — Full | + MCP config, skills (code-standards, spec), approved-deps, ADR directory |
21
21
 
22
22
  Each level includes all lower levels.
23
23
 
@@ -64,9 +64,11 @@ your-project/
64
64
  pre-bash-firewall.sh
65
65
  post-edit-format.sh
66
66
  ...
67
- skills/ # Coding standards skill
67
+ skills/ # Skills
68
68
  code-standards/
69
69
  SKILL.md
70
+ spec/
71
+ SKILL.md
70
72
  .mcp.json # MCP server config
71
73
  docs/
72
74
  approved-deps.md
package/dist/index.js CHANGED
@@ -472,6 +472,10 @@ function initLevel3(vars) {
472
472
  ".claude/skills/code-standards/SKILL.md",
473
473
  loadTemplate("level-3/code-standards.md")
474
474
  );
475
+ safeWrite(
476
+ ".claude/skills/spec/SKILL.md",
477
+ loadTemplate("level-3/spec.md")
478
+ );
475
479
  safeWrite("docs/approved-deps.md", loadAndRender("level-3/approved-deps.md", vars));
476
480
  const adrKeep = "docs/adr/.gitkeep";
477
481
  if (!import_node_fs4.default.existsSync(adrKeep)) {
@@ -511,6 +515,8 @@ async function runCheck(options) {
511
515
  checkGitignore(options.fix);
512
516
  checkEnvSafety();
513
517
  checkLongFiles();
518
+ checkAnyType();
519
+ checkDefaultExport();
514
520
  checkBannedDeps();
515
521
  checkEnvFilesTracked();
516
522
  console.log("");
@@ -621,6 +627,53 @@ ${longFiles.map((f) => ` - ${f}`).join("\n")}`);
621
627
  pass("All .ts/.tsx files are within 300 lines");
622
628
  }
623
629
  }
630
+ function checkAnyType() {
631
+ const anyFiles = [];
632
+ walkDir(".", (filepath) => {
633
+ if (!filepath.match(/\.(ts|tsx)$/) || filepath.includes("node_modules") || filepath.includes(".next") || filepath.includes("dist")) {
634
+ return;
635
+ }
636
+ const content = import_node_fs5.default.readFileSync(filepath, "utf-8");
637
+ const lines = content.split("\n");
638
+ for (let i = 0; i < lines.length; i++) {
639
+ const line = lines[i];
640
+ if (line.match(/:\s*any\b/) || line.match(/as\s+any\b/)) {
641
+ anyFiles.push(`${filepath}:${i + 1}`);
642
+ }
643
+ }
644
+ });
645
+ if (anyFiles.length > 0) {
646
+ warning(
647
+ `Found ${anyFiles.length} any type usage(s):
648
+ ${anyFiles.map((f) => ` - ${f}`).join("\n")}`
649
+ );
650
+ } else {
651
+ pass("No any type usage found in .ts/.tsx files");
652
+ }
653
+ }
654
+ function checkDefaultExport() {
655
+ const defaultExports = [];
656
+ walkDir(".", (filepath) => {
657
+ if (!filepath.match(/\.(ts|tsx)$/) || filepath.includes("node_modules") || filepath.includes(".next") || filepath.includes("dist")) {
658
+ return;
659
+ }
660
+ const content = import_node_fs5.default.readFileSync(filepath, "utf-8");
661
+ const lines = content.split("\n");
662
+ for (let i = 0; i < lines.length; i++) {
663
+ if (lines[i].match(/\bexport\s+default\b/)) {
664
+ defaultExports.push(`${filepath}:${i + 1}`);
665
+ }
666
+ }
667
+ });
668
+ if (defaultExports.length > 0) {
669
+ warning(
670
+ `Found ${defaultExports.length} default export(s):
671
+ ${defaultExports.map((f) => ` - ${f}`).join("\n")}`
672
+ );
673
+ } else {
674
+ pass("No default exports found in .ts/.tsx files");
675
+ }
676
+ }
624
677
  function checkBannedDeps() {
625
678
  const pkg = readJsonFile("package.json");
626
679
  if (!pkg) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-dev-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "AI Dev Lifecycle — scaffold & audit tool for Claude Code projects",
5
5
  "bin": {
6
6
  "ai-dev-cli": "dist/index.js"
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: spec
3
+ description: >
4
+ Requirement analysis and product definition. Use when you have a new idea,
5
+ feature request, or business need that requires formalization.
6
+ Produces a structured spec.md through Socratic questioning, as input for /plan.
7
+ ---
8
+
9
+ # Requirement Analysis & Product Definition
10
+
11
+ Transform vague ideas into a validated spec.md — the upstream input for /plan.
12
+
13
+ ## Process
14
+
15
+ 1. **Capture Raw Idea** — Let user express freely, then summarize back in one sentence
16
+ 2. **Socratic Questioning** — 5 Whys to find root problem + probe 3-5 key dimensions:
17
+ Clarification / Assumptions / Evidence / Perspectives / Implications / Meta-questions
18
+ 3. **Clarity Scoring** — Rate requirement on 100-point scale:
19
+ Business Context /20, Functional Clarity /30, Technical Specificity /25, Scope /25.
20
+ Must reach ≥ 90 before proceeding.
21
+ 4. **Strategy Exploration** — Compare 2-3 approaches (trade-offs, effort). User chooses.
22
+ 5. **User Stories** — Given/When/Then acceptance criteria (happy path + errors + edge cases)
23
+ 6. **Feature Breakdown** — Dependency graph + data model + API surface (when applicable)
24
+ 7. **Multi-Perspective Review** — Engineer / User / Business viewpoints
25
+ 8. **Generate spec.md** — Wait for user approval before proceeding to /plan
26
+
27
+ ## Output
28
+
29
+ Single file `docs/spec.md` (or `docs/[feature]-spec.md`) containing:
30
+ - Background & root problem (5 Whys chain)
31
+ - Objectives & anti-goals
32
+ - Target users with pain level
33
+ - Strategy chosen with rationale
34
+ - User stories with acceptance criteria
35
+ - Feature dependency graph
36
+ - Data model & API surface (if applicable)
37
+ - Risks from multi-perspective review
38
+ - Scope boundaries (in/out)
39
+ - Success metrics
40
+
41
+ ## When to Use
42
+
43
+ - New feature ideas that are still vague or need validation
44
+ - Medium-to-large features (cross-module, new data models, new APIs)
45
+ - Skip for small changes (< 3 files) — use /plan directly
46
+
47
+ ## Quality Gate
48
+
49
+ Before moving to /plan:
50
+ - [ ] Clarity Score ≥ 90
51
+ - [ ] Root problem identified (not surface request)
52
+ - [ ] ≥ 3 user stories with ≥ 3 acceptance criteria each
53
+ - [ ] Scope boundaries explicit (in AND out)
54
+ - [ ] ≥ 2 measurable success metrics
55
+ - [ ] Multi-perspective review completed
56
+ - [ ] User approved