@mthanhlm/autodev 0.2.1 → 0.2.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.
package/PUBLISH.md CHANGED
@@ -26,7 +26,7 @@ npm pack
26
26
  Check the tarball contents:
27
27
 
28
28
  ```bash
29
- tar -tf mthanhlm-autodev-0.2.1.tgz
29
+ tar -tf mthanhlm-autodev-0.2.2.tgz
30
30
  ```
31
31
 
32
32
  ## First Public Publish
@@ -526,6 +526,67 @@ function codebasePaths(cwd) {
526
526
  return Object.fromEntries(CODEBASE_FILES.map(name => [name.replace(/\.md$/, ''), path.join(codebaseDir, name)]));
527
527
  }
528
528
 
529
+ function buildStatus(cwd) {
530
+ const paths = rootPaths(cwd);
531
+ const route = buildRoute(cwd);
532
+ const config = loadConfig(cwd);
533
+ const existingCodebase = detectExistingCodebase(cwd);
534
+ const projectType = config.project.type || (existingCodebase ? 'brownfield' : 'greenfield');
535
+ const activeTrack = readActiveTrack(cwd);
536
+ const tracks = listTracks(cwd);
537
+
538
+ return {
539
+ cwd,
540
+ autodev_exists: fileExists(paths.root),
541
+ project_exists: fileExists(paths.project),
542
+ existing_code_detected: existingCodebase,
543
+ project_type: projectType,
544
+ project_path: paths.project,
545
+ project_state_path: paths.state,
546
+ active_track_path: paths.activeTrack,
547
+ active_track: activeTrack,
548
+ track_count: tracks.length,
549
+ tracks: tracks.map(track => ({
550
+ slug: track.slug,
551
+ name: track.name,
552
+ active: track.active
553
+ })),
554
+ codebase_map_exists: fileExists(paths.codebaseSummary),
555
+ route
556
+ };
557
+ }
558
+
559
+ function buildCleanupPayload(cwd) {
560
+ const paths = rootPaths(cwd);
561
+ const route = buildRoute(cwd);
562
+ const activeTrack = readActiveTrack(cwd);
563
+ const track = trackPaths(cwd, activeTrack);
564
+ const phases = activeTrack ? listPhases(cwd, activeTrack) : [];
565
+ const verifiedPhases = phases.filter(phase => phase.uatExists);
566
+ const completedPhases = phases.filter(phase => phase.summaryExists || phase.reviewExists || phase.uatExists);
567
+
568
+ return {
569
+ cwd,
570
+ autodev_exists: fileExists(paths.root),
571
+ project_exists: fileExists(paths.project),
572
+ project_state_path: paths.state,
573
+ active_track_path: paths.activeTrack,
574
+ active_track: activeTrack,
575
+ track_path: track ? track.dir : null,
576
+ track_state_path: track ? track.state : null,
577
+ phases_dir: track ? track.phasesDir : null,
578
+ archive_root: path.join(paths.root, 'archive'),
579
+ route,
580
+ phase_counts: {
581
+ total: phases.length,
582
+ completed: completedPhases.length,
583
+ verified: verifiedPhases.length
584
+ },
585
+ verified_phase_numbers: verifiedPhases.map(phase => phase.number),
586
+ verified_phase_dirs: verifiedPhases.map(phase => phase.dir)
587
+ };
588
+ }
589
+
529
590
  function initPayload(cwd, mode, requestedPhase) {
530
591
  const paths = rootPaths(cwd);
531
592
  const config = loadConfig(cwd);
@@ -626,6 +687,16 @@ function main() {
626
687
  return;
627
688
  }
628
689
 
690
+ if (command === 'status') {
691
+ printJson(buildStatus(cwd));
692
+ return;
693
+ }
694
+
695
+ if (command === 'cleanup') {
696
+ printJson(buildCleanupPayload(cwd));
697
+ return;
698
+ }
699
+
629
700
  if (command === 'route') {
630
701
  const mode = rest[0] || 'json';
631
702
  const route = buildRoute(cwd);
@@ -658,8 +729,10 @@ if (require.main === module) {
658
729
 
659
730
  module.exports = {
660
731
  autodevDir,
732
+ buildCleanupPayload,
661
733
  buildProgress,
662
734
  buildRoute,
735
+ buildStatus,
663
736
  detectExistingCodebase,
664
737
  initPayload,
665
738
  listPhases,
@@ -14,10 +14,10 @@ Use `/autodev` as the single entrypoint for the normal workflow. Route automatic
14
14
  1. Run:
15
15
 
16
16
  ```bash
17
- node "$HOME/.claude/autodev/bin/autodev-tools.cjs" init autodev
17
+ node "$HOME/.claude/autodev/bin/autodev-tools.cjs" status
18
18
  ```
19
19
 
20
- 2. Inspect the returned `route.kind`, `project_type`, `tracks`, and active phase data.
20
+ 2. Inspect the returned `route.kind`, `project_type`, `tracks`, and active track data.
21
21
 
22
22
  3. Route as follows, and complete the selected workflow in the same turn:
23
23
  - `init_project`: perform the new-project workflow.
@@ -13,12 +13,13 @@ Clean or archive autodev state without flags. Prefer preserving useful project c
13
13
  1. Run:
14
14
 
15
15
  ```bash
16
- node "$HOME/.claude/autodev/bin/autodev-tools.cjs" init autodev
16
+ node "$HOME/.claude/autodev/bin/autodev-tools.cjs" cleanup
17
17
  ```
18
18
 
19
19
  2. If no `.autodev/` project exists, stop and say there is nothing to clean.
20
20
 
21
- 3. Ask the user to choose one action:
21
+ 3. Use the `AskUserQuestion` tool for the choice below. Do not ask this in plain assistant text.
22
+ Ask the user to choose one action:
22
23
  - archive completed phase artifacts only
23
24
  - archive the current track and clear the active selection
24
25
  - delete all `.autodev/` state
@@ -35,7 +36,7 @@ node "$HOME/.claude/autodev/bin/autodev-tools.cjs" init autodev
35
36
  - update `.autodev/STATE.md` to `Current Step: track-selection` and `Next Command: /autodev`
36
37
 
37
38
  6. For `delete all .autodev state`:
38
- - ask the user to type `DELETE AUTODEV`
39
+ - use the `AskUserQuestion` tool to ask the user to type `DELETE AUTODEV`
39
40
  - only then remove `.autodev/`
40
41
 
41
42
  7. End with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mthanhlm/autodev",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A lean Claude Code workflow system with a single entrypoint, brownfield codebase mapping, and read-only git.",
5
5
  "bin": {
6
6
  "autodev": "bin/install.js"