Skip to content

Commit 0c5a1ee

Browse files
feat(scan): replace bash script with Python script for project discovery information collection
1 parent 2538230 commit 0c5a1ee

3 files changed

Lines changed: 744 additions & 338 deletions

File tree

skills/acquire-codebase-knowledge/SKILL.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22
name: acquire-codebase-knowledge
33
description: 'Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.'
44
license: MIT
5-
compatibility: 'Cross-platform. Preferred: run scripts/scan.sh with Bash. On Windows without Bash, run equivalent PowerShell discovery commands and keep the same output contract. Requires git and standard shell tooling.'
5+
compatibility: 'Cross-platform. Requires Python 3.8+ and git. Run scripts/scan.py from the target project root.'
66
metadata:
7-
version: "1.2"
7+
version: "1.3"
8+
enhancements:
9+
- Multi-language manifest detection (25+ languages supported)
10+
- CI/CD pipeline detection (10+ platforms)
11+
- Container & orchestration detection
12+
- Code metrics by language
13+
- Security & compliance config detection
14+
- Performance testing markers
815
argument-hint: 'Optional: specific area to focus on, e.g. "architecture only", "testing and concerns"'
916
---
1017

@@ -44,18 +51,17 @@ If the user supplies a focus area (for example: "architecture only" or "testing
4451

4552
### Phase 1: Scan and Read Intent
4653

47-
1. Set `SKILL_ROOT` to the absolute path of the skill folder (the directory containing this `SKILL.md`), then run the bundled script from the **target project root**:
54+
1. Run the scan script from the target project root:
4855
```bash
49-
export SKILL_ROOT="/absolute/path/to/skills/acquire-codebase-knowledge"
50-
bash "$SKILL_ROOT/scripts/scan.sh" --output docs/codebase/.codebase-scan.txt
56+
python3 "$SKILL_ROOT/scripts/scan.py" --output docs/codebase/.codebase-scan.txt
5157
```
52-
Keep your working directory as the target repository root so the scan covers that codebase, not the skill folder itself.
58+
Where `$SKILL_ROOT` is the absolute path to the skill folder. Works on Windows, macOS, and Linux.
5359

54-
**Windows fallback (limited — use only if Bash is unavailable):** The following produces a file listing only and does **not** include manifest previews, git churn, TODO/FIXME counts, or environment variable templates. Downstream phases will have reduced context.
55-
```powershell
56-
New-Item -ItemType Directory -Force -Path docs/codebase | Out-Null
57-
Get-ChildItem -Recurse -File | Select-Object -First 200 FullName | Out-File docs/codebase/.codebase-scan.txt
60+
**Quick start:** If you have the path inline:
61+
```bash
62+
python3 /absolute/path/to/skills/acquire-codebase-knowledge/scripts/scan.py --output docs/codebase/.codebase-scan.txt
5863
```
64+
5965
2. Search for `PRD`, `TRD`, `README`, `ROADMAP`, `SPEC`, `DESIGN` files and read them.
6066
3. Summarise the stated project intent before reading any source code.
6167

@@ -132,11 +138,26 @@ Validation pass criteria:
132138

133139
---
134140

141+
## Enhanced Scan Output Sections
142+
143+
The `scan.py` script now produce the following sections in addition to the original output:
144+
145+
- **CODE METRICS** — Total files, lines of code by language, largest files (complexity signals)
146+
- **CI/CD PIPELINES** — Detected GitHub Actions, GitLab CI, Jenkins, CircleCI, etc.
147+
- **CONTAINERS & ORCHESTRATION** — Docker, Docker Compose, Kubernetes, Vagrant configs
148+
- **SECURITY & COMPLIANCE** — Snyk, Dependabot, SECURITY.md, SBOM, security policies
149+
- **PERFORMANCE & TESTING** — Benchmark configs, profiling markers, load testing tools
150+
151+
Use these sections during Phase 2 to inform investigation questions and identify tool-specific patterns.
152+
153+
---
154+
135155
## Bundled Assets
136156

137157
| Asset | When to load |
138158
|-------|-------------|
139-
| [`scripts/scan.sh`](scripts/scan.sh) | Phase 1 — run first, before reading any code |
159+
| [`scripts/scan.py`](scripts/scan.py) | Phase 1 — run first, before reading any code (Python 3.8+ required) |
160+
140161
| [`references/inquiry-checkpoints.md`](references/inquiry-checkpoints.md) | Phase 2 — load for per-template investigation questions |
141162
| [`references/stack-detection.md`](references/stack-detection.md) | Phase 2 — only if stack is ambiguous |
142163
| [`assets/templates/STACK.md`](assets/templates/STACK.md) | Phase 3 step 1 |

0 commit comments

Comments
 (0)