Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .copilot-track/crawl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Crawl Track — GitHub Copilot AI Engineering

This directory contains documentation and resources for the **Crawl** level of the AI Engineering track, where you use GitHub Copilot as an **assistant** for single-file or single-module exercises.

## How This Track Works

### Chain of PRs
Each exercise builds on the previous one. Exercises are numbered Ex 0–15:
- **Ex 0 (Bootstrap):** Set up scaffolding and documentation
- **Ex 1–15:** Progressive exercises that grow in scope and complexity

Each exercise creates a new branch and PR. PRs are small, reversible, and focused on one goal.

### Branch Naming
All branches follow this pattern:
```
crawl/<github-id>/ex<N>-<short-name>
```

Example: `crawl/nowakfli/ex0-bootstrap`

### Evidence in PRs
Every PR must include:
1. **What changed:** Clear summary of modifications
2. **Why:** Motivation and acceptance criteria met
3. **Evidence:** Test output, logs, or metrics proving the change works
4. **Rollback plan:** How to quickly undo if needed

### Copilot Usage
In the Crawl track, Copilot helps with:
- **Inline suggestions:** Code completion while typing
- **/explain:** Understanding existing code
- **/tests:** Generating test cases
- **Chat prompts:** Planning changes before coding

Copilot is your *assistant*—you drive the work, Copilot provides suggestions.

## Repository Structure

```
.
├── ai-track-docs/ # Shared documentation across all exercises
│ ├── SYSTEM-OVERVIEW.md # Repo summary, entry points, test approach
│ ├── build-test.md # Exact build and test commands
│ ├── architecture.mmd # System diagram (Mermaid)
│ ├── dependencies.md # Dependency policy (added in Ex 7)
│ └── ... # Additional docs as exercises progress
├── .copilot-track/
│ └── crawl/ # Crawl track resources
│ └── README.md # This file
```

## Exercise Pattern

1. Create a branch: `git checkout -b crawl/<id>/ex<N>-<name>`
2. Send full prompt to Copilot Chat
3. Implement changes (Copilot assists)
4. Commit: `git add . && git commit -m "crawl: ex<N> <name>"`
5. Push: `git push -u origin crawl/<id>/ex<N>-<name>`
6. Open PR with evidence and rollback plan
7. Once approved, PR description becomes part of the track record

## Guardrails

- **Keep PRs small:** One goal per exercise
- **No secrets:** Don't commit API keys or credentials
- **Exclude vendor:** Don't modify `node_modules`, `vendor`, or submodules
- **Evidence required:** Every PR needs test output or metrics
- **Reversible:** Every change should be revertible in one commit

## Next Steps

Start with **Ex 1: Repo Orientation** to build a mental model of the codebase and pick a low-risk module to work with throughout the track.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ output.json
.env.test.local
.env.production.local

# Common secret and certificate files
*.pem
*.key
*.crt
*.cer
*.pfx
*.p12
secrets.*

# IDE and Editor directories
.vscode/*
!.vscode/extensions.json
Expand Down
77 changes: 77 additions & 0 deletions ai-track-docs/SYSTEM-OVERVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# System Overview

## Repository Purpose

This is the **GitHub Copilot CLI for Beginners** — an educational course teaching AI-assisted development workflows. The repo contains:
- Chapters 00–07 (Markdown lessons with hands-on exercises)
- Sample applications: Python (primary), C#, and JavaScript versions of a book collection CLI
- Supporting assets: images, skills, agent templates, MCP configs

**Primary Languages:** Python (exercise focus), C#, JavaScript, Markdown

## Entry Points

| Language | Entry Point | Purpose |
|----------|------------|---------|
| **Python** | `samples/book-app-project/book_app.py` | CLI: add/list/mark-as-read books |
| **C#** | `samples/book-app-project-cs/Program.cs` | CLI equivalent in C# |
| **JavaScript** | `samples/book-app-project-js/book_app.js` | CLI equivalent in JavaScript |

All three versions manage a book collection stored in `data.json`.

## Architecture

**Python Book App Structure:**
```
samples/book-app-project/
├── book_app.py # Main CLI handler (menu, user I/O)
├── books.py # BookCollection class + persistence (data.json)
├── utils.py # UI helpers (print_menu, get_user_choice, format output)
├── data.json # Persistent storage (book list)
└── tests/
└── test_books.py # Unit tests for BookCollection
```

**Key Components:**
- `BookCollection` — in-memory list with JSON persistence
- `Book` — dataclass representing a single book
- CLI handlers — user input/output management

## Test Approach

**Framework:** pytest (Python 3.10+)

**Test Coverage:**
- `samples/book-app-project/tests/test_books.py` — unit tests for `BookCollection`
- Uses monkeypatch fixture to isolate tests with temp data files
- Covers: add, list, find, mark-as-read, invalid operations

**Command to run tests:**
```bash
cd samples/book-app-project
pytest tests/ -v
```

## Dependencies

**Python (see `pyproject.toml`):**
- `Python >= 3.10`
- `pytest` (dev/test)

**C# & JavaScript:** Refer to respective package managers and project files.

## Low-Risk Module Selection (Exercise 1)

**Recommended: `samples/book-app-project/utils.py`**

| Module | Risk | Reasoning |
|--------|------|-----------|
| **utils.py** | **Low** | Isolated UI helpers; no state; easy to test; changes don't cascade |
| books.py | Medium | Core data model; tested but has broader impact |
| appendices/additional-context.md | Low | Documentation only; safe but not code-oriented |

**Why utils.py:** Functions like `print_menu()`, `get_user_choice()`, `get_book_details()`, and `print_books()` are perfect for practicing small, safe improvements (validation, error handling, formatting) without risking the core app logic.

## References
- See `build-test.md` for exact build and test commands
- See `architecture.mmd` for system diagram
14 changes: 14 additions & 0 deletions ai-track-docs/architecture.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
graph TD
A["Placeholder: System Component A"] --> B["Placeholder: Component B"]
B --> C["Placeholder: Component C"]
C --> D["Database"]
A --> E["External Service"]

style A fill:#e1f5ff
style B fill:#e1f5ff
style C fill:#e1f5ff
style D fill:#fff3e0
style E fill:#f3e5f5

classDef placeholder fill:#e0e0e0,color:#424242
class A,B,C,D,E placeholder
Comment on lines +2 to +14
92 changes: 92 additions & 0 deletions ai-track-docs/build-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Build and Test

## Prerequisites

| Tool | Requirement | Status |
|------|-------------|--------|
| **Python** | 3.10 or higher | Required |
| **pip** | Package manager | Included with Python 3.10+ |
| **pytest** | Test framework | Listed in `pyproject.toml` |

Verify: `python --version` should show `Python 3.10.x` or higher.

## Build Commands

### Python (Primary Sample)

Navigate to the project:
```bash
cd samples/book-app-project
```

Install the project with dev dependencies:
```bash
pip install -e .
```

This installs the `book-app` package in editable mode and includes `pytest`.

## Test Commands

### Run All Tests
```bash
cd samples/book-app-project
pytest tests/ -v
```

### Run Tests with Coverage Report
```bash
cd samples/book-app-project
pytest tests/ --cov=. --cov-report=term-missing
Comment on lines +37 to +40
```

### Run a Specific Test File
```bash
cd samples/book-app-project
pytest tests/test_utils.py -v
```

### Run a Single Test
```bash
cd samples/book-app-project
pytest tests/test_utils.py::test_get_book_details_valid_year -v
```

## Local Development

1. **Clone and navigate:**
```bash
git clone https://github.com/<your-username>/copilot-cli-for-beginners-mnf.git
cd copilot-cli-for-beginners-mnf/samples/book-app-project
```

2. **Install in editable mode:**
```bash
pip install -e .
```

3. **Run the app:**
```bash
python book_app.py
```

4. **Run tests after changes:**
```bash
pytest tests/ -v
```

## Verification (Exercise 2 Baseline)

After making changes, verify locally:
```bash
cd samples/book-app-project
pytest tests/ -v
```

Expected output: All tests pass (green checkmarks).

## Baseline Tests Added

- `test_utils.py` — Unit tests for utility functions
- `test_get_book_details_valid_year()` — Verifies year parsing works correctly
- `test_get_book_details_invalid_year()` — Verifies invalid years default to 0
31 changes: 31 additions & 0 deletions ai-track-docs/dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Dependency Notes

## Scope

These notes cover the primary sample in `samples/book-app-project/`.

## Critical Dependencies

- Python: `>=3.10`
- Reason: the sample course content assumes a modern Python version and the project metadata already requires 3.10 or newer.
- pytest: `>=8,<9`
- Reason: pytest is the project's test dependency, and constraining it to the current major version reduces surprise breakage from future major releases.

## Current Policy

- Prefer bounded version ranges for tool dependencies used in course exercises.
- Keep changes small: allow patch and minor updates within a known-good major version before considering an upgrade.
- Re-run the sample test suite after any dependency change.

## Current Gaps

- `pytest` is listed in core dependencies even though it is only needed for validation workflows.
- There is no lock file for the Python sample, so installs can still vary slightly across environments within the allowed version range.

## Verification

Run from the repo root:

```bash
python -m pytest samples/book-app-project/tests -q
```
Loading
Loading