@devobsessed/code-captain 0.2.1 → 0.3.0

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/bin/install.js CHANGED
@@ -691,6 +691,11 @@ class CodeCaptainInstaller {
691
691
  },
692
692
  { name: "Copilot Agents", value: "agents", checked: true },
693
693
  { name: "Copilot Prompts", value: "prompts", checked: true },
694
+ {
695
+ name: "VS Solution View (Directory.Build.props)",
696
+ value: "vs-solution",
697
+ checked: false,
698
+ },
694
699
  ];
695
700
 
696
701
  case "claude":
@@ -852,6 +857,83 @@ class CodeCaptainInstaller {
852
857
  }
853
858
  }
854
859
 
860
+ // Install Directory.Build.props with merge support
861
+ async installDirectoryBuildProps() {
862
+ const targetPath = "Directory.Build.props";
863
+ const templateSource = "copilot/Directory.Build.props";
864
+ const marker = 'Label="Code Captain"';
865
+
866
+ // Read template content
867
+ let templateContent;
868
+ if (this.config.localSource) {
869
+ const localPath = path.join(this.config.localSource, templateSource);
870
+ if (!(await fs.pathExists(localPath))) {
871
+ throw new Error(`Template not found: ${localPath}`);
872
+ }
873
+ templateContent = await fs.readFile(localPath, "utf8");
874
+ } else {
875
+ const url = `${this.config.baseUrl}/${templateSource}`;
876
+ const response = await this.fetchWithTimeout(url, {}, 20000);
877
+ if (!response.ok) {
878
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
879
+ }
880
+ templateContent = await response.text();
881
+ }
882
+
883
+ // Extract the ItemGroup block from template
884
+ const itemGroupMatch = templateContent.match(
885
+ /[ \t]*<ItemGroup Label="Code Captain">[\s\S]*?<\/ItemGroup>/
886
+ );
887
+ if (!itemGroupMatch) {
888
+ throw new Error("Template missing Code Captain ItemGroup");
889
+ }
890
+ const itemGroupBlock = itemGroupMatch[0];
891
+
892
+ const exists = await fs.pathExists(targetPath);
893
+
894
+ if (!exists) {
895
+ // Case 1: File doesn't exist — create from template
896
+ await fs.writeFile(targetPath, templateContent);
897
+ return { action: "created" };
898
+ }
899
+
900
+ // File exists — read it
901
+ const existingContent = await fs.readFile(targetPath, "utf8");
902
+
903
+ if (existingContent.includes(marker)) {
904
+ // Case 3: Already has Code Captain content — replace if changed
905
+ const existingBlock = existingContent.match(
906
+ /[ \t]*<ItemGroup Label="Code Captain">[\s\S]*?<\/ItemGroup>/
907
+ );
908
+ if (existingBlock && existingBlock[0] === itemGroupBlock) {
909
+ return { action: "up-to-date" };
910
+ }
911
+
912
+ // Replace existing block
913
+ await fs.copy(targetPath, `${targetPath}.backup`);
914
+ const updatedContent = existingContent.replace(
915
+ /[ \t]*<ItemGroup Label="Code Captain">[\s\S]*?<\/ItemGroup>/,
916
+ itemGroupBlock
917
+ );
918
+ await fs.writeFile(targetPath, updatedContent);
919
+ return { action: "updated" };
920
+ }
921
+
922
+ // Case 2: File exists, no Code Captain content — inject before </Project>
923
+ await fs.copy(targetPath, `${targetPath}.backup`);
924
+ if (!existingContent.includes("</Project>")) {
925
+ throw new Error(
926
+ "Directory.Build.props is malformed (missing </Project>). Please fix manually."
927
+ );
928
+ }
929
+ const injectedContent = existingContent.replace(
930
+ /<\/Project>/,
931
+ `\n${itemGroupBlock}\n</Project>`
932
+ );
933
+ await fs.writeFile(targetPath, injectedContent);
934
+ return { action: "merged" };
935
+ }
936
+
855
937
  // Get IDE-specific file list
856
938
  getIDEFiles(selectedIDE, selectedComponents = null) {
857
939
  const files = [];
@@ -1029,6 +1111,17 @@ class CodeCaptainInstaller {
1029
1111
  spinner.text = `Installing files... (${completed}/${files.length})`;
1030
1112
  }
1031
1113
 
1114
+ // Handle Directory.Build.props for vs-solution component (opt-in only, not in installAll)
1115
+ let vsSolutionResult = null;
1116
+ if (
1117
+ !installOptions.installAll &&
1118
+ selectedComponents &&
1119
+ selectedComponents.includes("vs-solution")
1120
+ ) {
1121
+ spinner.text = "Installing Directory.Build.props...";
1122
+ vsSolutionResult = await this.installDirectoryBuildProps();
1123
+ }
1124
+
1032
1125
  spinner.succeed(
1033
1126
  `${this.ides[selectedIDE].name} integration installed successfully!`
1034
1127
  );
@@ -1050,6 +1143,7 @@ class CodeCaptainInstaller {
1050
1143
  installOptions.changeInfo.newFiles.length > 0),
1051
1144
  backupsCreated: backupPaths.length > 0,
1052
1145
  backupPaths: backupPaths,
1146
+ vsSolutionResult,
1053
1147
  };
1054
1148
  } catch (error) {
1055
1149
  spinner.fail("Installation failed");
@@ -1173,6 +1267,18 @@ class CodeCaptainInstaller {
1173
1267
  break;
1174
1268
  }
1175
1269
 
1270
+ // Show Directory.Build.props result if applicable
1271
+ if (installResult.vsSolutionResult) {
1272
+ const action = installResult.vsSolutionResult.action;
1273
+ const messages = {
1274
+ created: "Created Directory.Build.props — .github/ files now visible in VS Solution Explorer",
1275
+ merged: "Merged Code Captain items into existing Directory.Build.props (backup saved as .backup)",
1276
+ updated: "Updated Code Captain section in Directory.Build.props (backup saved as .backup)",
1277
+ "up-to-date": "Directory.Build.props is already up to date",
1278
+ };
1279
+ console.log(chalk.cyan("\n📁 VS Solution View:"), messages[action]);
1280
+ }
1281
+
1176
1282
  console.log(
1177
1283
  "\n" + chalk.green("🚀 Ready to start building with Code Captain!")
1178
1284
  );
@@ -0,0 +1,8 @@
1
+ <Project>
2
+ <!-- Code Captain: Make .github/ Copilot files visible in VS Solution Explorer -->
3
+ <ItemGroup Label="Code Captain">
4
+ <None Include=".github\copilot-instructions.md" Link="Code Captain\copilot-instructions.md" />
5
+ <None Include=".github\agents\**\*" Link="Code Captain\agents\%(RecursiveDir)%(Filename)%(Extension)" />
6
+ <None Include=".github\prompts\**\*" Link="Code Captain\prompts\%(RecursiveDir)%(Filename)%(Extension)" />
7
+ </ItemGroup>
8
+ </Project>
@@ -53,6 +53,28 @@ All Code Captain output is organized under `.code-captain/`:
53
53
  ### Meta
54
54
  - `new-command` - Create new Code Captain commands following established patterns
55
55
 
56
+ ## Terminal Command Standards
57
+
58
+ When executing terminal commands via `runCommands`:
59
+
60
+ 1. **Non-interactive only** — Never run commands that require user input or enter watch/interactive mode
61
+ - Vitest: `npx vitest run` (never bare `npx vitest` which enters watch mode)
62
+ - Jest: `npx jest --ci`
63
+ - dotnet: `dotnet test` (already non-interactive)
64
+ 2. **No long-running processes** — Never start dev servers, file watchers, or background services through `runCommands`. They will block the chat session indefinitely.
65
+ 3. **CWD preservation** — Use single-expression commands when working in subdirectories: `cd <subdir> && <command>`. Never leave the terminal in a shifted working directory. All `.code-captain/` paths are relative to the repository root.
66
+ 4. **Quick verification** — Prefer non-blocking checks over full builds. Use `--dry-run`, `--no-restore`, or type-check-only flags when assessing project health.
67
+ 5. **Verify before using npm scripts** — If a `package.json` `test` or `build` script exists, check its contents before running it. Scripts may invoke watch mode or dev servers.
68
+
69
+ ## Monorepo & Solution Awareness
70
+
71
+ Projects may contain multiple sub-projects (e.g., .NET solutions with React frontends). When working in these projects:
72
+
73
+ 1. **Detect project topology early** — Look for `.sln` files, multiple `package.json` files, or workspace configurations (`pnpm-workspace.yaml`, `lerna.json`, `nx.json`). This tells you the project has subdirectories with independent tooling.
74
+ 2. **Identify the target subdirectory** — Determine which sub-project contains the code relevant to the current task. Note its path relative to the repo root.
75
+ 3. **Root-relative file references** — All `.code-captain/` paths (specs, progress trackers, docs) are relative to the repository root, not any subdirectory. After running commands in a subdirectory, verify the working directory before referencing `.code-captain/` paths.
76
+ 4. **Subdirectory-specific tooling** — Each sub-project may have its own `package.json`, test runner, build tool, and configuration. Don't assume the root-level tooling applies to subdirectories.
77
+
56
78
  ## Behavioral Rules
57
79
 
58
80
  - **Challenge ideas** - If a requirement seems technically infeasible, the scope is too large, or the approach conflicts with existing patterns, say so directly. Suggest alternatives.
@@ -21,53 +21,51 @@ Your mission: Create a comprehensive Architecture Decision Record (ADR) that doc
21
21
 
22
22
  ## Prerequisites
23
23
 
24
- **MANDATORY:** Automatically execute research if no relevant research exists. The ADR creation process will:
24
+ **MANDATORY:** Ensure research context exists before creating the ADR. The process will:
25
25
 
26
- 1. Check for existing research on the decision topic
27
- 2. If no research found: **automatically read and execute** the complete research workflow from `/research`
26
+ 1. Check for existing research on the decision topic in `.code-captain/research/`
27
+ 2. If no research found: conduct targeted inline research as part of Step 0
28
28
  3. Only proceed with ADR creation after research is completed and documented
29
29
 
30
- ### Step 0: Check for Existing Research and Auto-Execute if Missing
30
+ ### Step 0: Research Verification & Targeted Research
31
31
 
32
- **Objective:** Ensure comprehensive research exists before creating ADR - automatically execute research if missing
32
+ **Objective:** Ensure sufficient research context exists before creating the ADR
33
33
 
34
34
  **Actions:**
35
35
 
36
36
  1. **Check for existing research:**
37
-
38
37
  - Use `search` to look for related research in `.code-captain/research/` directory
39
- - Search for research documents that might relate to the architectural decision
38
+ - Search for research documents that relate to the architectural decision topic
40
39
  - Use `codebase` to explore the research directory structure
41
40
 
42
- 2. **Automatic research execution if missing:**
43
-
44
- ```
45
- If no relevant research found:
46
- "No existing research found for this architectural decision.
47
-
48
- Architecture Decision Records require comprehensive research to document alternatives properly.
49
-
50
- AUTOMATICALLY EXECUTING RESEARCH WORKFLOW FIRST...
41
+ 2. **If relevant research exists:**
42
+ - Load and summarize key findings
43
+ - Identify any gaps that need additional investigation for the ADR
44
+ - Proceed to Step 1 with research context loaded
51
45
 
52
- Reading research workflow and executing complete research process..."
53
- ```
46
+ 3. **If NO relevant research exists conduct targeted ADR research inline:**
54
47
 
55
- 3. **Execute research workflow automatically:**
48
+ Perform focused research specific to the architectural decision (do NOT attempt to invoke the `/research` command as a sub-prompt):
56
49
 
57
- - **IMMEDIATELY** execute the complete `/research` command
58
- - **CREATE** research document in `.code-captain/research/{date}-{topic}-research.md`
59
- - **ONLY CONTINUE** with ADR creation after research is completed
50
+ a. **Define the decision scope** What specific architectural question needs answering?
51
+ b. **Gather alternatives** Use `fetch` to research 2-4 approaches:
52
+ - "[technology/pattern] architectural approaches"
53
+ - "[option A] vs [option B] comparison"
54
+ - "[technology] production experience case study"
55
+ c. **Evaluate against project context** — Use `codebase` to understand how each alternative fits the current architecture
56
+ d. **Document findings** — Get the current date using `npx @devobsessed/code-captain date`, then create a research document in `.code-captain/research/[DATE]-[topic]-research.md` with key findings, pros/cons, and sources
60
57
 
61
- 4. **Handle research workflow:**
62
- - If no research found: **AUTOMATICALLY execute complete research workflow first**
63
- - If existing research found: Load and reference it throughout the ADR process
64
- - If research is incomplete: Execute additional research before continuing
58
+ 4. **Progress checkpoint:**
59
+ Before proceeding to Step 1, confirm:
60
+ - Research document exists and is referenced
61
+ - At least 2 alternatives have been identified with pros/cons
62
+ - Project-specific implications have been assessed
65
63
 
66
64
  **Deliverables:**
67
65
 
68
66
  - Research availability assessment
69
- - **Completed research documentation** (auto-executed if missing)
70
- - Research document ready for ADR reference
67
+ - Research document (loaded from existing or created inline)
68
+ - Summary of key findings ready for ADR reference
71
69
 
72
70
  ### Step 1: Analyze Decision Context and Current State
73
71
 
@@ -141,6 +141,9 @@ Options:
141
141
  #### Step 2.1: Create Backup & Change Documentation
142
142
 
143
143
  **Backup Process:**
144
+
145
+ **IMPORTANT:** Use repo-root-relative paths for all backup operations. If working in a monorepo or solution with subdirectories, ensure all `.code-captain/` paths reference the repository root, not the current working directory. Use `editFiles` for file creation rather than `runCommands` with `cp` when possible to avoid cwd drift.
146
+
144
147
  1. **CREATE** backup folder: `.code-captain/specs/[spec-folder]/backups/`
145
148
  2. **COPY** all current files to `backups/[timestamp]/`
146
149
  3. **CREATE** change log entry in `CHANGELOG.md` within spec folder
@@ -44,6 +44,7 @@ Create `.code-captain/current-task-progress.md` to track the execution process:
44
44
  ## Progress Steps:
45
45
  - [x] Task discovery and selection
46
46
  - [ ] Context gathering from specs and codebase
47
+ - [ ] Project structure & infrastructure verification
47
48
  - [ ] Subtask execution in TDD order
48
49
  - [ ] Test verification (100% pass rate required)
49
50
  - [ ] Task completion and status update
@@ -51,6 +52,12 @@ Create `.code-captain/current-task-progress.md` to track the execution process:
51
52
  ## Current Step: Task Discovery
52
53
  ```
53
54
 
55
+ **Progress tracker update triggers:**
56
+ - Update after completing each numbered sub-task
57
+ - Update when encountering unexpected prerequisite work (e.g., "Added test framework setup — not in original task list")
58
+ - Record test run results with pass/fail counts after each test execution
59
+ - Update the "Current Step" indicator as you move through phases
60
+
54
61
  ### Step 2: Context Gathering & Analysis
55
62
 
56
63
  **Load specification context:**
@@ -70,6 +77,51 @@ Use `codebase` and `search` to understand:
70
77
  - Integration points for new features
71
78
  - Testing frameworks and conventions
72
79
 
80
+ ### Step 2.5: Project Structure & Infrastructure Verification
81
+
82
+ Before writing any code or tests, verify the project environment.
83
+
84
+ **Check existing project documentation:**
85
+
86
+ - If `.code-captain/docs/tech-stack.md` exists and contains project topology and test infrastructure status, use it rather than re-detecting from scratch
87
+ - Only perform fresh detection if `tech-stack.md` is missing or stale
88
+
89
+ **Detect project structure:**
90
+
91
+ 1. Search for `*.sln` files at the repository root
92
+ 2. If a solution file exists:
93
+ - Identify project subdirectories (client, server, shared, etc.)
94
+ - Determine which subdirectory contains the implementation target
95
+ - Note the repo root path — all `.code-captain/` references are relative to root
96
+ 3. If no solution file exists, treat the workspace root as the project root
97
+
98
+ **Verify test infrastructure:**
99
+
100
+ 1. Check `package.json` (in the target directory) for a `test` script and test-related `devDependencies`
101
+ 2. If NO test framework exists:
102
+ - Select a test runner aligned with the project's build tool (e.g., Vitest for Vite, Jest for Webpack/CRA)
103
+ - Install minimum required packages (test runner, DOM environment, assertion matchers)
104
+ - Configure the test runner in the project's existing config file
105
+ - Create a setup file if needed (e.g., for jest-dom matchers)
106
+ - Add a `test` script to `package.json`
107
+ - Run a trivial smoke test to confirm the framework works before writing real tests
108
+ 3. If a test framework exists, verify it runs successfully with any existing tests
109
+ 4. Document test infrastructure additions in the progress tracker
110
+
111
+ **Select test strategies (based on project stack):**
112
+
113
+ For JavaScript/TypeScript projects:
114
+ - **Component behavior tests**: Use the project's testing library (e.g., React Testing Library with `render`, `screen`, `fireEvent`) for rendered output and interactions
115
+ - **Static file content tests** (CSS variables, import assertions, file structure): Use Node.js `fs.readFileSync` to read source files as text — do NOT use `fetch()` which is unavailable or incomplete in test DOM environments (jsdom does not support `fetch` for `file://` URLs)
116
+ - **Integration tests**: Use the test runner's DOM environment for full component mounting
117
+
118
+ For .NET projects:
119
+ - Use the project's existing test framework (xUnit, NUnit, MSTest)
120
+ - Run tests with `dotnet test` (already non-interactive)
121
+
122
+ For other stacks:
123
+ - Align test strategy with the framework and conventions detected in `tech-stack.md` or discovered during infrastructure verification
124
+
73
125
  ### Step 3: Story & Task Analysis
74
126
 
75
127
  Parse selected story structure and validate TDD approach within story using file-based progress tracking instead of todo_write.
@@ -84,7 +136,16 @@ Execute story tasks in sequential order with file-based tracking:
84
136
  - Write comprehensive test cases for the entire feature
85
137
  - Include unit tests, integration tests, and edge cases
86
138
  - Cover happy path, error conditions, and boundary cases
87
- - Ensure tests fail appropriately (red phase)
139
+ - Use the appropriate test strategy from Step 2.5 (component tests vs static file tests vs integration tests)
140
+
141
+ **Red Phase Verification (mandatory before proceeding to green phase):**
142
+ 1. Run the test suite after writing tests
143
+ 2. Confirm tests produce **assertion failures** (e.g., "expected X but received Y") — not runtime errors or crashes
144
+ 3. If tests error/crash instead of failing (e.g., `TypeError`, `fetch failed`, `Module not found`):
145
+ - This means the test infrastructure or test approach is broken, not the feature code
146
+ - Fix the test setup or rewrite the test approach
147
+ - Re-run until tests fail cleanly with assertion messages
148
+ 4. Only proceed to the green phase once all tests fail with clear assertion errors
88
149
 
89
150
  #### Tasks 2-N: Implementation (Green Phase)
90
151
 
@@ -118,12 +179,18 @@ Update story file status and progress tracking files with completion details, en
118
179
  - `codebase` - Understanding existing architecture and patterns
119
180
  - `search` - Finding related code and patterns
120
181
  - `editFiles` - Implementing code changes
121
- - `runCommands` - Executing build processes
182
+ - `runCommands` - Executing build processes (follow Terminal Command Standards from system instructions)
122
183
  - `runTests` - Running test suites
123
184
  - `findTestFiles` - Locating test files
124
185
  - `testFailure` - Analyzing test failures
125
186
 
187
+ **Terminal discipline (see system instructions for full standards):**
188
+ - Always use non-interactive, single-run flags for test runners (e.g., `vitest run`, `jest --ci`)
189
+ - Never start dev servers or watch-mode processes — they block the chat session
190
+ - When running commands in subdirectories, use `cd <subdir> && <command>` to preserve cwd
191
+ - Verify `npm test` script contents before using it — scripts may invoke watch mode
192
+
126
193
  **Progress tracking:**
127
194
  - File-based progress tracking in `.code-captain/current-task-progress.md`
128
195
  - Story status updates in specification files
129
- - Test execution results documentation
196
+ - Test execution results documentation with pass/fail counts
@@ -9,7 +9,7 @@ You MUST follow these instructions exactly. Do NOT describe this process — exe
9
9
 
10
10
  Your mission: Analyze the current project and set up the technical foundation. Detect whether this is a greenfield (new) or brownfield (existing) project, scan the codebase, and generate foundational documentation.
11
11
 
12
- ### Step 1: Project Type Detection
12
+ ### Step 1: Project Type & Structure Detection
13
13
 
14
14
  **Scan for existing code:**
15
15
  - Check for common files indicating existing project (package.json, pom.xml, etc.)
@@ -17,6 +17,16 @@ Your mission: Analyze the current project and set up the technical foundation. D
17
17
  - Identify project structure patterns
18
18
  - Determine if greenfield (new) or brownfield (existing) project
19
19
 
20
+ **Detect project topology:**
21
+ - Search for `*.sln` files at the repository root (indicates .NET solution / monorepo)
22
+ - Search for multiple `package.json` files (indicates JavaScript/TypeScript monorepo)
23
+ - Check for workspace configurations (`pnpm-workspace.yaml`, `lerna.json`, `nx.json`)
24
+ - If a solution or monorepo is detected:
25
+ - Map all sub-projects and their locations relative to the repo root
26
+ - Identify which sub-projects are frontend, backend, shared libraries, etc.
27
+ - Note each sub-project's independent tooling (build tool, test runner, package manager)
28
+ - Document the topology in Step 3 (tech-stack.md)
29
+
20
30
  ### Step 2: Project Analysis
21
31
 
22
32
  **For Brownfield Projects:**
@@ -25,6 +35,15 @@ Your mission: Analyze the current project and set up the technical foundation. D
25
35
  - Infer project purpose and goals
26
36
  - Generate comprehensive documentation
27
37
 
38
+ **Test infrastructure inventory (all project types):**
39
+ - For each sub-project (or the root project if not a monorepo):
40
+ - Check `package.json` for `test` script and test-related `devDependencies`
41
+ - Identify the test runner (Vitest, Jest, xUnit, NUnit, MSTest, pytest, etc.)
42
+ - Note the test configuration file location (vite.config, jest.config, etc.)
43
+ - Check if a test setup file exists (test-setup.js, setupTests.ts, etc.)
44
+ - Record whether tests currently pass, fail, or if no test infrastructure exists
45
+ - Document findings in `tech-stack.md` so downstream commands (especially `execute-task`) have this context
46
+
28
47
  **For Greenfield Projects:**
29
48
  - Guide through strategic project setup questions
30
49
  - Recommend technology stack based on requirements
@@ -34,7 +53,10 @@ Your mission: Analyze the current project and set up the technical foundation. D
34
53
 
35
54
  Generate foundational documents in `.code-captain/docs/`:
36
55
 
37
- - **tech-stack.md** - Complete technology inventory and analysis
56
+ - **tech-stack.md** - Complete technology inventory and analysis. Must include:
57
+ - Project topology (single project, monorepo, or .NET solution with sub-projects)
58
+ - For each sub-project: build tool, test runner (or "none"), test configuration location
59
+ - Test infrastructure status: "ready" (tests exist and pass), "configured" (framework installed but no tests), or "missing" (no test framework)
38
60
  - **code-style.md** - Observed patterns and coding conventions
39
61
  - **objective.md** - Inferred or defined project purpose and goals
40
62
  - **architecture.md** - System architecture overview and decisions
@@ -57,6 +79,13 @@ Provide clear guidance on next steps, typically:
57
79
  - `findTestFiles` - Locating test files and patterns
58
80
  - `problems` - Identifying code issues
59
81
 
82
+ **Terminal discipline:** Follow Terminal Command Standards from system instructions. When detecting build tools and dependencies, use non-blocking commands (e.g., check file existence rather than running full builds). In monorepos, use `cd <subdir> && <command>` to avoid cwd drift.
83
+
60
84
  **Documentation organization:**
61
85
  - Progress documented in `.code-captain/initialization-progress.md`
62
86
  - Results organized in `.code-captain/docs/` folder
87
+
88
+ **Progress tracker updates:**
89
+ - Update `.code-captain/initialization-progress.md` after completing each step
90
+ - Record unexpected findings (e.g., "No test framework found in client project")
91
+ - Document project topology discoveries as they occur
@@ -28,6 +28,8 @@ Your mission: Provide the developer with a comprehensive status report. Analyze
28
28
  **Code Captain Integration:**
29
29
  - Scan `.code-captain/specs/` for active specifications
30
30
  - Parse current task progress from most recent spec's user-stories/
31
+ - Check `.code-captain/current-task-progress.md` for in-flight execution state
32
+ - Check `.code-captain/initialization-progress.md` for initialization status
31
33
  - Identify completed vs pending tasks
32
34
  - Determine current user story context
33
35
 
@@ -38,16 +40,26 @@ Your mission: Provide the developer with a comprehensive status report. Analyze
38
40
 
39
41
  ### Step 3: Project Health Check
40
42
 
41
- **Basic Viability:**
42
- - Can the project build/compile? (language-specific checks)
43
- - Are core services startable?
44
- - Any obvious configuration issues?
45
- - Dependencies status (package.json, requirements.txt, etc.)
43
+ **IMPORTANT: Use passive, non-blocking checks only. Do NOT run builds, start services, or execute long-running commands.**
44
+
45
+ **Basic Viability (file-based heuristics):**
46
+ - Check for build artifacts (e.g., `dist/`, `build/`, `bin/`, `obj/`) — presence suggests a recent successful build
47
+ - Check lock file freshness (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`) — staleness may indicate missing dependencies
48
+ - Check for TypeScript errors via `problems` tool if available
49
+ - Verify key configuration files exist (`.env`, `appsettings.json`, etc.)
50
+ - Check `node_modules/` existence — missing suggests `npm install` is needed
51
+ - For .NET projects: check for `*.csproj` build errors via `problems` tool, not `dotnet build`
52
+
53
+ **Do NOT run these commands during status checks:**
54
+ - `npm run build`, `dotnet build`, or any full compilation
55
+ - `npm start`, `dotnet run`, or any dev server startup
56
+ - `npm test` or `dotnet test` — report test infrastructure status from file inspection only
46
57
 
47
58
  **Immediate Blockers:**
48
59
  - Merge conflicts that need resolution
49
- - Missing environment variables or config files
50
- - Failed builds or critical errors
60
+ - Missing environment variables or config files (check for `.env.example` without corresponding `.env`)
61
+ - Missing `node_modules/` or other dependency directories
62
+ - Stale lock files suggesting dependency drift
51
63
 
52
64
  ### Step 4: Output the Status Report
53
65
 
@@ -97,7 +109,7 @@ QUICK COMMANDS
97
109
  **Primary tools:**
98
110
  - `codebase` - Analyzing project structure and Code Captain specs
99
111
  - `search` - Finding active specifications and related documentation
100
- - `runCommands` - Git commands and system health checks
112
+ - `runCommands` - Git commands only (follow Terminal Command Standards from system instructions — no builds, no dev servers)
101
113
  - `problems` - Identifying project health issues and conflicts
102
114
  - `changes` - Tracking recent modifications and activity
103
115
 
package/manifest.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
- "version": "0.2.1",
3
- "timestamp": "2026-02-11T22:08:16.461Z",
4
- "commit": "7e98b73506f53002dcf0c08a7e440ee19249e5a2",
2
+ "version": "0.3.0",
3
+ "timestamp": "2026-02-12T13:09:10.578Z",
4
+ "commit": "a18e9dc145c3990823850611b321d0713e63d657",
5
5
  "description": "Code Captain file manifest for change detection",
6
6
  "files": {
7
7
  "cursor/cc.mdc": {
8
8
  "hash": "sha256:92bf482f44684af5072358908dfece0247470d14d7bdfd15d7ee83a9127ff199",
9
9
  "size": 4800,
10
10
  "lastModified": "2025-11-25T16:41:04.604Z",
11
- "version": "0.2.1",
11
+ "version": "0.3.0",
12
12
  "component": "rules",
13
13
  "description": "You are **Code Captain** - a methodical AI development partner who executes comprehensive software w..."
14
14
  },
@@ -16,7 +16,7 @@
16
16
  "hash": "sha256:5a80261ed75b56c6eb58b7e11a951f5ac1cdf184290582bdd8210bea1bb820b2",
17
17
  "size": 15818,
18
18
  "lastModified": "2025-11-25T16:41:04.605Z",
19
- "version": "0.2.1",
19
+ "version": "0.3.0",
20
20
  "component": "commands",
21
21
  "description": "Create comprehensive Architecture Decision Records (ADRs) that systematically document architectural..."
22
22
  },
@@ -24,7 +24,7 @@
24
24
  "hash": "sha256:f7305a4584b2f291fc494bee035c20d7dd48dc2f6ea913982ee96773e24e8499",
25
25
  "size": 17742,
26
26
  "lastModified": "2025-11-25T16:41:04.605Z",
27
- "version": "0.2.1",
27
+ "version": "0.3.0",
28
28
  "component": "commands",
29
29
  "description": "Generate comprehensive feature specifications using a contract-first approach that ensures complete ..."
30
30
  },
@@ -32,7 +32,7 @@
32
32
  "hash": "sha256:95836eba17d903953a4c4209a69c33eb6ad19f276f472d66c13887a8094868e2",
33
33
  "size": 16803,
34
34
  "lastModified": "2025-11-25T16:41:04.605Z",
35
- "version": "0.2.1",
35
+ "version": "0.3.0",
36
36
  "component": "commands",
37
37
  "description": "Modify existing feature specifications using a contract-first approach that ensures complete alignme..."
38
38
  },
@@ -40,7 +40,7 @@
40
40
  "hash": "sha256:01323eaf32a4b44cc4c2abdaccd728245448070235a8d623751449e8daf23871",
41
41
  "size": 16496,
42
42
  "lastModified": "2025-11-25T16:41:04.605Z",
43
- "version": "0.2.1",
43
+ "version": "0.3.0",
44
44
  "component": "commands",
45
45
  "description": "Execute a specific task and its sub-tasks systematically following a Test-Driven Development (TDD) w..."
46
46
  },
@@ -48,7 +48,7 @@
48
48
  "hash": "sha256:e44b9353ca3fa1f332af52f1e2b6148e152bb12a16e52b81cc9f5794d453a9e2",
49
49
  "size": 6974,
50
50
  "lastModified": "2025-11-25T16:41:04.605Z",
51
- "version": "0.2.1",
51
+ "version": "0.3.0",
52
52
  "component": "commands",
53
53
  "description": "The `explain-code` command provides comprehensive, AI-powered explanations of code segments, functio..."
54
54
  },
@@ -56,7 +56,7 @@
56
56
  "hash": "sha256:a519ecaacb02097b1d12a43a34ac3498a6bf9b47ecc6cb6621dd84b3d4970a10",
57
57
  "size": 11267,
58
58
  "lastModified": "2025-11-25T16:41:04.605Z",
59
- "version": "0.2.1",
59
+ "version": "0.3.0",
60
60
  "component": "commands",
61
61
  "description": "Set up technical foundation and development infrastructure by detecting if this is a greenfield (new..."
62
62
  },
@@ -64,7 +64,7 @@
64
64
  "hash": "sha256:3b3d9be4e4b66ca4bd461b2dee8681217fd3c6681dced4736e6d85e793efef3e",
65
65
  "size": 14341,
66
66
  "lastModified": "2025-11-25T16:41:04.606Z",
67
- "version": "0.2.1",
67
+ "version": "0.3.0",
68
68
  "component": "commands",
69
69
  "description": "A meta command that creates new Code Captain commands following established patterns and conventions..."
70
70
  },
@@ -72,7 +72,7 @@
72
72
  "hash": "sha256:90a69bc3334a69af98aa0814e7a00e1e2c4ce4cd0abf32b04f3c577f9437f221",
73
73
  "size": 16455,
74
74
  "lastModified": "2025-11-25T16:41:04.606Z",
75
- "version": "0.2.1",
75
+ "version": "0.3.0",
76
76
  "component": "commands",
77
77
  "description": "Generate comprehensive product planning documentation using a contract-first approach that establish..."
78
78
  },
@@ -80,7 +80,7 @@
80
80
  "hash": "sha256:6def0906545267f6fe14f1d920baa8cce0fdb27f3bae45c2ab9b22e3e6464e0e",
81
81
  "size": 8595,
82
82
  "lastModified": "2025-11-25T16:41:04.606Z",
83
- "version": "0.2.1",
83
+ "version": "0.3.0",
84
84
  "component": "commands",
85
85
  "description": "Conduct systematic research on a topic using structured phases that build upon each other, creating ..."
86
86
  },
@@ -88,7 +88,7 @@
88
88
  "hash": "sha256:48ea3bd849cdfb566778f6d84090878c287cee3e07dd4ec997bdc51fcca40ea4",
89
89
  "size": 12793,
90
90
  "lastModified": "2025-11-25T16:41:04.606Z",
91
- "version": "0.2.1",
91
+ "version": "0.3.0",
92
92
  "component": "commands",
93
93
  "description": "A command that provides developers with a comprehensive status report when starting work or switchin..."
94
94
  },
@@ -96,7 +96,7 @@
96
96
  "hash": "sha256:9faa9403fbd24b992bdd3c6cff204a6c867fb4068a79188ec7cbe5662daf1e4d",
97
97
  "size": 8270,
98
98
  "lastModified": "2025-11-25T16:41:04.606Z",
99
- "version": "0.2.1",
99
+ "version": "0.3.0",
100
100
  "component": "commands",
101
101
  "description": "A deck-cleaning agent that makes one small, focused improvement to the codebase, following the \"Boy ..."
102
102
  },
@@ -104,111 +104,111 @@
104
104
  "hash": "sha256:727c8ae467010da039c41d013c2557d689bfca16f8a93e6b8744c89fa66e27ba",
105
105
  "size": 2177,
106
106
  "lastModified": "2025-11-25T16:41:04.606Z",
107
- "version": "0.2.1",
107
+ "version": "0.3.0",
108
108
  "component": "docs",
109
109
  "description": "Global development guidelines for Agent OS projects."
110
110
  },
111
111
  "copilot/copilot-instructions.md": {
112
- "hash": "sha256:9264535377631fad4c858b539cfe010923819cd2f4398126d95870aadef3b96a",
113
- "size": 3863,
114
- "lastModified": "2026-02-11T19:30:16.898Z",
115
- "version": "0.2.1",
112
+ "hash": "sha256:0f11ce5c0f1ba589f59741027ed6daee95a2d73623d4219c42919125060a801c",
113
+ "size": 6003,
114
+ "lastModified": "2026-02-12T12:44:12.842Z",
115
+ "version": "0.3.0",
116
116
  "component": "instructions",
117
117
  "description": "You are **Code Captain** - a methodical AI development partner who executes comprehensive software w..."
118
118
  },
119
119
  "copilot/agents/Code Captain.agent.md": {
120
120
  "hash": "sha256:98abb65bb7e48283c8f84a8e679d5bc7935455f2142d6d28465fc59ddd77bbf9",
121
121
  "size": 2639,
122
- "lastModified": "2026-02-11T19:38:06.851Z",
123
- "version": "0.2.1",
122
+ "lastModified": "2026-02-11T22:17:25.559Z",
123
+ "version": "0.3.0",
124
124
  "component": "agents",
125
125
  "description": "Code Captain - AI Development Partner"
126
126
  },
127
127
  "copilot/prompts/create-adr.prompt.md": {
128
- "hash": "sha256:d96a955d9e589f1c7d88853eac6e42d7c079eae66e2d2153082ac75c10c64073",
129
- "size": 11775,
130
- "lastModified": "2026-02-11T19:32:48.270Z",
131
- "version": "0.2.1",
128
+ "hash": "sha256:98398b6f0869d4eb84f08760cf38b6553d107714acc58e392a975d263dae3f44",
129
+ "size": 12092,
130
+ "lastModified": "2026-02-12T12:48:34.927Z",
131
+ "version": "0.3.0",
132
132
  "component": "prompts",
133
133
  "description": "Create Architecture Decision Records with research and analysis"
134
134
  },
135
135
  "copilot/prompts/create-spec.prompt.md": {
136
136
  "hash": "sha256:f30bf21f2a9df38c85a28ad530a52a363b883ea912c4eda492efd6d2dd1d9b02",
137
137
  "size": 13846,
138
- "lastModified": "2026-02-11T19:31:45.860Z",
139
- "version": "0.2.1",
138
+ "lastModified": "2026-02-11T22:17:25.560Z",
139
+ "version": "0.3.0",
140
140
  "component": "prompts",
141
141
  "description": "Generate feature specifications using a contract-first approach"
142
142
  },
143
143
  "copilot/prompts/edit-spec.prompt.md": {
144
- "hash": "sha256:50c533454e73dbfcc2db0eaef77bfa201a472b467760610a7a4002dee572419f",
145
- "size": 9193,
146
- "lastModified": "2026-02-11T19:34:06.084Z",
147
- "version": "0.2.1",
144
+ "hash": "sha256:47b4c636620083d4b5e113afafc358dc1aa5015ca55a6d414ff62543fc53f026",
145
+ "size": 9528,
146
+ "lastModified": "2026-02-12T12:46:48.988Z",
147
+ "version": "0.3.0",
148
148
  "component": "prompts",
149
149
  "description": "Modify existing feature specifications with change tracking"
150
150
  },
151
151
  "copilot/prompts/execute-task.prompt.md": {
152
- "hash": "sha256:a7b847a5ad23bd240481c0c1f4d416404654f748346448ba9c1d48c71b69a3cd",
153
- "size": 4605,
154
- "lastModified": "2026-02-11T19:34:37.040Z",
155
- "version": "0.2.1",
152
+ "hash": "sha256:729171a3564b322e46920e8e7b379542bd52c7d0b2d78594e78758b770418791",
153
+ "size": 8726,
154
+ "lastModified": "2026-02-12T12:48:51.235Z",
155
+ "version": "0.3.0",
156
156
  "component": "prompts",
157
157
  "description": "Execute implementation tasks using TDD from specifications"
158
158
  },
159
159
  "copilot/prompts/explain-code.prompt.md": {
160
160
  "hash": "sha256:63a083e461fd536f9232ae9051d97b83cb0dedb956353d63d41fce10a5c73ec5",
161
161
  "size": 4031,
162
- "lastModified": "2026-02-11T19:34:58.891Z",
163
- "version": "0.2.1",
162
+ "lastModified": "2026-02-11T22:17:25.560Z",
163
+ "version": "0.3.0",
164
164
  "component": "prompts",
165
165
  "description": "Generate comprehensive code explanations with diagrams"
166
166
  },
167
167
  "copilot/prompts/initialize.prompt.md": {
168
- "hash": "sha256:a07e22de68c6d8adea0e428b546056cac45c17424ebe5d841e02b25707106883",
169
- "size": 2328,
170
- "lastModified": "2026-02-11T19:35:13.466Z",
171
- "version": "0.2.1",
168
+ "hash": "sha256:b9cf96bf153c77eb759cca6074dec0cb49c0700c7cde96743e8af7d71b8d72c0",
169
+ "size": 4450,
170
+ "lastModified": "2026-02-12T12:45:46.356Z",
171
+ "version": "0.3.0",
172
172
  "component": "prompts",
173
173
  "description": "Analyze and set up project foundation with documentation"
174
174
  },
175
175
  "copilot/prompts/new-command.prompt.md": {
176
176
  "hash": "sha256:ed321a43dcd7276a65752a97573acad956cd8904667544d795b7441d643a71f0",
177
177
  "size": 5516,
178
- "lastModified": "2026-02-11T19:35:49.887Z",
179
- "version": "0.2.1",
178
+ "lastModified": "2026-02-11T22:17:25.561Z",
179
+ "version": "0.3.0",
180
180
  "component": "prompts",
181
181
  "description": "Create new Code Captain commands following established patterns"
182
182
  },
183
183
  "copilot/prompts/plan-product.prompt.md": {
184
184
  "hash": "sha256:e7614e39e7b1d04f6cb8952188a9539422a26d2d2da754799f6424e167e3ea28",
185
185
  "size": 6854,
186
- "lastModified": "2026-02-11T19:36:29.070Z",
187
- "version": "0.2.1",
186
+ "lastModified": "2026-02-11T22:17:25.561Z",
187
+ "version": "0.3.0",
188
188
  "component": "prompts",
189
189
  "description": "Transform product ideas into comprehensive plans"
190
190
  },
191
191
  "copilot/prompts/research.prompt.md": {
192
192
  "hash": "sha256:33702a0fd7b87059f7163e09d66b305cf9a06531d4133ab9c999a9f3d9795f56",
193
193
  "size": 5333,
194
- "lastModified": "2026-02-11T19:36:56.106Z",
195
- "version": "0.2.1",
194
+ "lastModified": "2026-02-11T22:17:25.561Z",
195
+ "version": "0.3.0",
196
196
  "component": "prompts",
197
197
  "description": "Conduct systematic research using structured phases"
198
198
  },
199
199
  "copilot/prompts/status.prompt.md": {
200
- "hash": "sha256:9e33640760c5af58498eecdb4dc6f9e97f5b53fadb8a296fb449ba111ada135f",
201
- "size": 3734,
202
- "lastModified": "2026-02-11T19:37:19.619Z",
203
- "version": "0.2.1",
200
+ "hash": "sha256:a0dc9009a9b031d42c3cff0cf26d289a0269ccc2cfcc36c1b42951caa3f9eba2",
201
+ "size": 4866,
202
+ "lastModified": "2026-02-12T12:48:58.243Z",
203
+ "version": "0.3.0",
204
204
  "component": "prompts",
205
205
  "description": "Provide comprehensive project status with next actions"
206
206
  },
207
207
  "copilot/prompts/swab.prompt.md": {
208
208
  "hash": "sha256:79604fde524fd1e7c785ea1d7e84316929e17084c42c9928d1114f127bec0a80",
209
209
  "size": 2847,
210
- "lastModified": "2026-02-11T19:37:38.987Z",
211
- "version": "0.2.1",
210
+ "lastModified": "2026-02-11T22:17:25.562Z",
211
+ "version": "0.3.0",
212
212
  "component": "prompts",
213
213
  "description": "Make one focused code improvement following the Boy Scout Rule"
214
214
  },
@@ -216,15 +216,23 @@
216
216
  "hash": "sha256:727c8ae467010da039c41d013c2557d689bfca16f8a93e6b8744c89fa66e27ba",
217
217
  "size": 2177,
218
218
  "lastModified": "2025-11-25T16:41:04.601Z",
219
- "version": "0.2.1",
219
+ "version": "0.3.0",
220
220
  "component": "docs",
221
221
  "description": "Global development guidelines for Agent OS projects."
222
222
  },
223
+ "copilot/Directory.Build.props": {
224
+ "hash": "sha256:3a9c06c556e462dd5697d6852bcef712af3ab80581d00cee7f2de412a7abb729",
225
+ "size": 475,
226
+ "lastModified": "2026-02-11T23:21:47.573Z",
227
+ "version": "0.3.0",
228
+ "component": "vs-solution",
229
+ "description": "<!-- Code Captain: Make .github/ Copilot files visible in VS Solution Explorer -->"
230
+ },
223
231
  "claude-code/agents/code-captain.md": {
224
232
  "hash": "sha256:6d87de22934ab5eecc48a899907dba6c38d2ecc30e96aa871eaf4fe4d500a08f",
225
233
  "size": 5832,
226
234
  "lastModified": "2025-11-25T16:41:04.600Z",
227
- "version": "0.2.1",
235
+ "version": "0.3.0",
228
236
  "component": "agents",
229
237
  "description": "Comprehensive AI development partner for coordinating software development workflows. Use proactively for project setup, requirements analysis, feature specifications, architecture decisions, implementation planning, and platform integrations across the entire development lifecycle."
230
238
  },
@@ -232,7 +240,7 @@
232
240
  "hash": "sha256:ee220ded638b37fe29c519f8b21311b535c871b9d0f276d0cb7a609241bac497",
233
241
  "size": 8644,
234
242
  "lastModified": "2025-11-25T16:41:04.600Z",
235
- "version": "0.2.1",
243
+ "version": "0.3.0",
236
244
  "component": "agents",
237
245
  "description": "Specialized agent for generating core specification documents from locked contracts. Creates spec.md and spec-lite.md files with proper structure and formatting."
238
246
  },
@@ -240,7 +248,7 @@
240
248
  "hash": "sha256:3968ec61d6530c165d594448ad703ddee9fb4ddc84fe6a414c6ed4fcc836c596",
241
249
  "size": 11225,
242
250
  "lastModified": "2025-11-25T16:41:04.600Z",
243
- "version": "0.2.1",
251
+ "version": "0.3.0",
244
252
  "component": "agents",
245
253
  "description": "Specialized agent for creating user stories with focused task breakdown. Generates individual story files with 5-7 tasks each, following TDD patterns and ensuring each story delivers standalone user value."
246
254
  },
@@ -248,7 +256,7 @@
248
256
  "hash": "sha256:22e055c35614ff928c62540eb3459b8841b2f48852d999ab949d35ebc9cdd108",
249
257
  "size": 12800,
250
258
  "lastModified": "2025-11-25T16:41:04.600Z",
251
- "version": "0.2.1",
259
+ "version": "0.3.0",
252
260
  "component": "agents",
253
261
  "description": "Specialized agent for generating technical specifications based on requirements. Creates architecture documents, database schemas, API specs, and UI wireframes only when needed, ensuring technical details support user story implementation."
254
262
  },
@@ -256,7 +264,7 @@
256
264
  "hash": "sha256:5f401313635a46278251df9cba31c0228270b15d6ddd06cf64c72274cee39ea4",
257
265
  "size": 25185,
258
266
  "lastModified": "2026-02-11T15:17:33.463Z",
259
- "version": "0.2.1",
267
+ "version": "0.3.0",
260
268
  "component": "claude-commands",
261
269
  "description": "Generate comprehensive feature specifications using a contract-first approach that ensures complete ..."
262
270
  },
@@ -264,14 +272,14 @@
264
272
  "hash": "sha256:7c94db2c53c3b937377074d1ef272cdc9b026ebb108c68770c4836f476a7abdc",
265
273
  "size": 15817,
266
274
  "lastModified": "2025-11-25T16:41:04.601Z",
267
- "version": "0.2.1",
275
+ "version": "0.3.0",
268
276
  "component": "claude-commands",
269
277
  "description": "Set up technical foundation and development infrastructure by detecting if this is a greenfield (new..."
270
278
  }
271
279
  },
272
280
  "changelog": {
273
- "0.2.1": {
274
- "date": "2026-02-11",
281
+ "0.3.0": {
282
+ "date": "2026-02-12",
275
283
  "changes": []
276
284
  }
277
285
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devobsessed/code-captain",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Unified AI Development Agent System with intelligent change detection",
5
5
  "type": "module",
6
6
  "bin": {