Skip to content
Draft
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
20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"image": "mcr.microsoft.com/devcontainers/base:noble",
"name": "",
"features": {
"ghcr.io/tomgrv/devcontainer-features/githooks:5": {},
"ghcr.io/tomgrv/devcontainer-features/gitutils:5": {},
"ghcr.io/tomgrv/devcontainer-features/gitversion:7": {}
},
"remoteEnv": {},
"postCreateCommand": [
"mkdir -p /home/vscode/.ssh && chmod 700 /home/vscode/.ssh && ssh-keyscan github.com >>/home/vscode/.ssh/known_hosts",
"sudo chown -Rf vscode:vscode ${containerWorkspaceFolder:-.}/* ${containerWorkspaceFolder:-.}/.*",
"sudo find ${containerWorkspaceFolder:-.} -mindepth 1 -type d -exec chmod 755 {} +"
],
"postStartCommand": [
"git config --global --add safe.directory ${containerWorkspaceFolder:-.}",
"test -z \"$CODESPACES\" && git config --global gpg.program gpg2"
],
"customizations": {}
}
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
*.json merge=json
CHANGELOG.md export-ignore
21 changes: 21 additions & 0 deletions .github/instructions/general.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
applyTo: '**'
---

<!-- @format -->

## Minimal Changes Discipline

Make the smallest possible change to address the specific request. Do not modify files unrelated to the task.

- **Package files** (`package.json`, `package-lock.json`): only modify if explicitly required for the task.
- **Build artifacts and symlinks**: do not commit unless they are the direct target of the request.
- **Repository setup** (symlinks, environment bootstrapping): use temporarily for development/testing only; do not commit.
- **Infrastructure changes**: avoid unless specifically requested.

When working on any task:

1. Identify the **exact files** that need to change.
2. Change **only** those files.
3. Use temporary local setup for testing; revert any unrelated side effects before committing.
4. Focus on the **specific feature or fix** requested, not general improvements.
38 changes: 38 additions & 0 deletions .github/skills/feature-common-utils/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: feature-common-utils
description: Shared shell utilities for JSON validation, normalization, and reusable zz_* helper scripts.
---

<!-- @format -->

# common-utils

## Description

Use this feature as a shared utility layer for shell-based automation across features (`jq`, `dos2unix`, and `zz_*` helper scripts).

## Commands

- `validate-json [options] <json>` - Validate JSON against a schema.
- `normalize-json [options] <json>` - Normalize JSON order/format using schema rules.
- `zz_dist [options]` - Copy `zz_*` helpers to a target directory.
- `zz_args` - Parse command-line arguments in shell scripts.
- `zz_log` - Emit structured/colorized shell logs.
- `zz_json` - Read or manipulate JSON from shell scripts.

## Use For

- JSON validation/normalization workflows (`validate-json`, `normalize-json`).
- Shell scripting with standardized logging, argument parsing, and prompts (`zz_log`, `zz_args`, `zz_ask`).
- Distributing shared helper scripts into project folders (`zz_dist`).

## Do Not Use For

- Feature-specific business logic.
- Git workflow automation (use `gitutils` or `githooks`).

## Agent Guidance

- Reuse existing `zz_*` scripts before adding new helpers.
- Prefer `normalize-json`/`validate-json` in lint pipelines for schema-safe edits.
- Keep automation generic and composable for cross-feature reuse.
36 changes: 36 additions & 0 deletions .github/skills/feature-gitversion/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: feature-gitversion
description: Semantic versioning utilities that derive versions from git history and update tags/changelog.
---

<!-- @format -->

# gitversion

## Description

Use this feature when an agent must derive application version numbers from Git history in a consistent way.

## Commands

- `gv` - Compute version metadata from Git history.
- `bump-version` - Update version fields/files from computed version.
- `bump-tag` - Create/update version tag from release version.
- `bump-changelog` - Generate or update changelog for release context.

## Use For

- Calculating semantic versions from branch/commit state.
- Providing version metadata for build/release automation.
- Aligning local version behavior with CI versioning.

## Do Not Use For

- Manual tag/edit workflows without GitVersion involvement.
- Hook or lint orchestration (use `githooks`).

## Agent Guidance

- Use the installed GitVersion tooling as the source of truth for computed versions.
- Keep versioning logic centralized; avoid duplicating derivation rules in scripts.
- Pair with release helpers only when version flow is explicitly required.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Thumbs.db
.idea/
*.swp
*.swo
./.gitattributes
3 changes: 3 additions & 0 deletions .gitversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
major-version-bump-message: "^(build|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
patch-version-bump-message: "^(build|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"
9 changes: 9 additions & 0 deletions oc_mentor/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OpenClassrooms credentials
OC_EMAIL=your@email.com
OC_PASSWORD=yourpassword

# Optional: override where browser auth state is persisted (default: ~/.oc_mentor/auth-state.json)
# AUTH_STATE_PATH=/custom/path/auth-state.json

# Optional: set to "false" to run browser in headed mode for debugging
# PLAYWRIGHT_HEADLESS=false
5 changes: 5 additions & 0 deletions oc_mentor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
.env
*.auth-state.json
~/.oc_mentor/
125 changes: 125 additions & 0 deletions oc_mentor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# oc_mentor

OpenClassrooms mentor RPA connector + MCP server.
Works as both a **Claude Code tool** (stdio) and a **Claude.ai integration** (HTTP).

Exposes 8 tools backed by Playwright browser automation against the OC mentor portal:

| Tool | Description |
|---|---|
| `oc_login` | Authenticate (called automatically on first use) |
| `oc_status` | Auth state, student count, next session |
| `oc_list_sessions` | List upcoming/past sessions |
| `oc_get_session` | Session detail + notes |
| `oc_update_session_notes` | Write session notes |
| `oc_list_projects` | List student projects (pending/evaluated) |
| `oc_get_project` | Project brief, deliverables, competencies |
| `oc_submit_evaluation` | Submit pass/fail evaluation with feedback |

---

## Setup

### 1. Install

```bash
npm install
npx playwright install chromium
```

### 2. Configure credentials

```bash
cp .env.example .env
# Edit .env — set OC_EMAIL and OC_PASSWORD
```

### 3. Build

```bash
npm run build
```

---

## Use with Claude Code (stdio)

Add to `~/.claude/settings.json`:

```json
{
"mcpServers": {
"oc_mentor": {
"command": "node",
"args": ["/absolute/path/to/oc_mentor/dist/index.js"],
"env": {
"OC_EMAIL": "your@email.com",
"OC_PASSWORD": "yourpassword"
}
}
}
}
```

Restart Claude Code — the `oc_*` tools will appear in the tool list.

---

## Use as a Claude.ai integration (HTTP)

Claude.ai supports remote MCP servers via its **Integrations** settings.

### Start the HTTP server

```bash
# Set a secret token to protect the endpoint
MCP_AUTH_TOKEN=mysecrettoken npm run start:http
# → [oc_mentor] HTTP MCP server → http://localhost:3000/mcp
```

For production, run behind a reverse proxy (nginx, Caddy) with TLS.
Set `PORT=<n>` to change the port.

### Add to Claude.ai

1. Open **claude.ai → Settings → Integrations**
2. Click **Add custom integration**
3. Enter the server URL: `https://your-server.com/mcp` (or `http://localhost:3000/mcp` for local)
4. Set authentication: **Bearer token** → paste the value of `MCP_AUTH_TOKEN`
5. Save — the `oc_*` tools will appear in Claude.ai conversations

### Test the endpoint

```bash
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mysecrettoken" \
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}'
```

---

## Verify stdio mode

```bash
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node dist/index.js
# → JSON with all 8 tools
```

---

## Debug (headed browser)

```bash
PLAYWRIGHT_HEADLESS=false npm run start:http
```

---

## Session persistence

Auth state is saved to `~/.oc_mentor/auth-state.json` after first login and reused for up to 8 hours.

## Selector maintenance

OC's frontend may update its DOM — if tools stop returning data, run in headed mode and use DevTools to update selectors in `src/connector/`.
28 changes: 28 additions & 0 deletions oc_mentor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "oc_mentor",
"version": "1.0.0",
"description": "OpenClassrooms mentor RPA connector + MCP server for Claude Code and Claude.ai",
"type": "module",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"start:http": "MCP_TRANSPORT=http node dist/index.js",
"dev": "tsx src/index.ts",
"dev:http": "MCP_TRANSPORT=http tsx src/index.ts"
},
"engines": {
"node": ">=18"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.0",
"dotenv": "^16.4.5",
"playwright": "^1.49.0",
"zod": "^3.24.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"tsx": "^4.19.0",
"typescript": "^5.7.0"
}
}
Loading
Loading