Skip to content

Commit d57c440

Browse files
authored
chore: add repository-specific copilot instructions (#12)
* chore: add repository-specific copilot instructions * fix: address copilot review comments on instructions - Fix CLI command: validate, not verify - Clarify version: wrapper version (2.4.0) vs CORE_VERSION in manager.py - Fix cache dir: uses platformdirs.user_cache_dir with versioned subdirectory - Clarify CORE_VERSION tracks core binary release, not wrapper version - Add conditional check for workspace context files (may not exist)
1 parent 9f70af7 commit d57c440

1 file changed

Lines changed: 83 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# capiscio-python - GitHub Copilot Instructions
2+
3+
## ABSOLUTE RULES - NO EXCEPTIONS
4+
5+
### 1. ALL WORK VIA PULL REQUESTS
6+
- **NEVER commit directly to `main`.** All changes MUST go through PRs.
7+
8+
### 2. LOCAL CI VALIDATION BEFORE PUSH
9+
- Run: `pytest -v`
10+
11+
### 3. NO WATCH/BLOCKING COMMANDS
12+
- **NEVER run blocking commands** without timeout
13+
14+
---
15+
16+
## CRITICAL: Read First
17+
18+
**If working inside the CapiscIO monorepo workspace that includes `.context/`, read these workspace context files before starting work:**
19+
1. `../../.context/CURRENT_SPRINT.md` - Sprint goals and priorities
20+
2. `../../.context/ACTIVE_TASKS.md` - Active tasks
21+
22+
If these files are not present in your checkout of this repository, skip this step.
23+
24+
---
25+
26+
## Repository Purpose
27+
28+
**capiscio-python** is the Python/PyPI CLI wrapper for capiscio-core. It auto-downloads
29+
the platform-specific Go binary and passes all commands through transparently.
30+
31+
Published to PyPI as `capiscio`. Users install via `pip install capiscio`.
32+
33+
**This is NOT the Python SDK** — that's `capiscio-sdk-python`.
34+
35+
**Technology Stack**: Python 3.10+, hatchling (build), rich (CLI output)
36+
37+
**Current Version**: v2.4.0 (wrapper); core binary version is controlled by `CORE_VERSION` in `src/capiscio/manager.py`
38+
**Default Branch:** `main`
39+
40+
## Architecture
41+
42+
This is a **thin passthrough wrapper**, NOT a reimplementation. All logic lives in capiscio-core.
43+
44+
```
45+
capiscio-python/
46+
├── src/capiscio/
47+
│ ├── __init__.py
48+
│ ├── cli.py # Main entry point - parses args, delegates to binary
49+
│ └── manager.py # Downloads + caches platform-specific capiscio-core binary
50+
├── tests/ # Test suite
51+
├── pyproject.toml # Package config (name: "capiscio", hatchling build)
52+
└── docs/ # Documentation
53+
```
54+
55+
### How It Works
56+
57+
1. User runs `capiscio validate agent-card.json`
58+
2. `cli.py` invokes `manager.run_core()` to ensure Go binary is downloaded
59+
3. Binary is cached in an OS-specific cache directory resolved by `get_cache_dir()`, which uses `platformdirs.user_cache_dir("capiscio", "capiscio")` and stores binaries under a versioned subdirectory
60+
4. All args are passed through to the Go binary via `subprocess`
61+
62+
## Quick Commands
63+
64+
```bash
65+
pip install -e ".[dev]" # Install in dev mode
66+
pytest -v # Run tests
67+
uv sync # Sync deps with uv
68+
```
69+
70+
## Critical Rules
71+
72+
- **Never add CLI logic here** — all commands belong in capiscio-core
73+
- Binary downloads use GitHub Releases from `capiscio/capiscio-core`
74+
- Platform detection: `platform.system()` + `platform.machine()`
75+
- The `CORE_VERSION` constant in `src/capiscio/manager.py` must track the capiscio-core release tag used for the downloaded binary; the Python package version can differ
76+
- **Don't confuse with capiscio-sdk-python** — this is the CLI wrapper, that's the SDK
77+
78+
## Publishing
79+
80+
PyPI publish is triggered by pushing a git tag matching `v*`.
81+
```bash
82+
git tag v2.4.1 && git push origin v2.4.1 # Triggers PyPI publish
83+
```

0 commit comments

Comments
 (0)