Skip to content

Commit 92a568c

Browse files
committed
Introduce coding agent instructions and skills
1 parent 76ad5e4 commit 92a568c

26 files changed

Lines changed: 3834 additions & 3 deletions

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../AGENTS.md
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
applyTo: ".github/skills/**/*.md,.github/instructions/**/*.md,AGENTS.md"
3+
---
4+
# Agent Files — Caveman Style
5+
6+
Files in `.github/skills/`, `.github/instructions/`, and `AGENTS.md` must use [caveman skill](./../skills/caveman/SKILL.md) to keep context short and tokens efficient.
7+
8+
## Applies To
9+
10+
- `AGENTS.md`
11+
- `.github/skills/**/*.md` (skill files and support docs)
12+
- `.github/instructions/**/*.md` (instruction files)
13+
14+
## Caveman Rule
15+
16+
All text except code blocks and security warnings:
17+
- Drop articles (a/an/the)
18+
- No filler (just, really, basically, actually, simply)
19+
- No pleasantries (sure, certainly, of course, happy to)
20+
- Fragments OK. Short synonyms (big not extensive)
21+
- Technical terms exact
22+
- Pattern: `[thing] [action] [reason]. [next step].`
23+
24+
**Default intensity:** full
25+
26+
See [caveman skill](./../skills/caveman/SKILL.md) for lite/ultra and examples.
27+
28+
## Exception
29+
30+
Security warnings + irreversible action confirmations → normal English. Resume caveman after warning complete.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
applyTo: "**/*.cypher"
3+
---
4+
# Cypher Query Conventions
5+
6+
## Style
7+
8+
- **First line: description comment** — format: `// Description sentence. Requires "Other_Query.cypher".`
9+
Used in generated [CYPHER.md](../../CYPHER.md) reference
10+
- Blank line between comment and statement
11+
- One statement per file — no combining without explicit approval
12+
- Standard Cypher where possible. Use APOC sparingly — confirm with user first
13+
- Parameterize with `$parameterName`
14+
- Keywords uppercase: `MATCH`, `WHERE`, `RETURN`, `WITH`, `SET`, `ORDER BY`, `LIMIT`, etc.
15+
- Literals lowercase: `null`, `true`, `false`
16+
- Each clause own line — no inline chaining
17+
- `ORDER BY` and `LIMIT` on own lines
18+
- Single quotes for strings: `'value'` not `"value"`
19+
- No semicolons at end
20+
21+
## Naming
22+
23+
- Files: `Snake_Case_Description.cypher`
24+
- Node labels: `PascalCase`
25+
- Relationship types: `UPPER_SNAKE_CASE`
26+
- Properties: `camelCase`
27+
- No backtick-quoted identifiers — use clean label/property names
28+
29+
## Spacing
30+
31+
- One space between label predicate and property predicate: `(n:Label {prop: 1})`
32+
- Space after each comma: `a, b, c` not `a,b,c`
33+
- Wrapping space around operators: `a <> b`, `p = (s)-->(e)`
34+
- No padding space inside function calls: `count(n)` not `count( n )`
35+
36+
## Patterns
37+
38+
- Anonymous nodes/rels when variable unused: `[:LIKES]` not `[r:LIKES]`
39+
40+
## Verification
41+
42+
Before finalizing query, verify against live Neo4j to catch syntax errors and warnings.
43+
Requires Neo4j running — use [neo4j-management skill](./../skills/neo4j-management/SKILL.md) first.
44+
45+
```shell
46+
# From repo root — NEO4J_INITIAL_PASSWORD must be exported
47+
./scripts/executeQuery.sh <path/to/query.cypher>
48+
```
49+
50+
- Empty result ≠ broken query — data may be absent
51+
- `executeQueryFunctions.sh` for script composition only — not for ad-hoc verification
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
applyTo: "CYPHER.md,SCRIPTS.md,ENVIRONMENT_VARIABLES.md"
3+
---
4+
# Generated Reference Files
5+
6+
[CYPHER.md](../../CYPHER.md), [SCRIPTS.md](../../SCRIPTS.md), [ENVIRONMENT_VARIABLES.md](../../ENVIRONMENT_VARIABLES.md)**auto-generated**. Do not edit directly. Changes get overwritten.
7+
8+
## Do Not Run Generators Manually
9+
10+
Generators run automatically in pipeline — output **auto-committed**. Running locally, including result in commit causes **git merge conflicts** in pipeline. Only run generator if user explicitly insists.
11+
12+
## Influence Indirectly
13+
14+
| File | Edit instead |
15+
|------|--------------|
16+
| `CYPHER.md` | First line `// Description.` of each `.cypher` file |
17+
| `SCRIPTS.md` | First line `# Description.` of each `.sh` file |
18+
| `ENVIRONMENT_VARIABLES.md` | Inline `# comment` after env var declaration in `.sh` files |
19+
20+
Moved/renamed files detected and reflected automatically on next pipeline run.
21+
22+
## Generators
23+
24+
See [scripts/documentation/](../../scripts/documentation/):
25+
26+
- `generateCypherReference.sh``CYPHER.md`
27+
- `generateScriptReference.sh``SCRIPTS.md`
28+
- `generateEnvironmentVariableReference.sh` + `appendEnvironmentVariables.sh``ENVIRONMENT_VARIABLES.md`
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
applyTo: "requirements.txt,conda-environment.yml"
3+
---
4+
# Python Dependency Conventions
5+
6+
Applies to [requirements.txt](../../requirements.txt) and [conda-environment.yml](../../conda-environment.yml).
7+
8+
## Sync Rule
9+
10+
Both files must stay **in sync**: same packages, same pinned versions. Package in one must be in other.
11+
12+
Known exceptions (document inline with comment if they differ):
13+
- `conda-environment.yml` may split packages (e.g. `nbconvert` + `nbconvert-webpdf` vs. `nbconvert[webpdf]` in pip)
14+
- `conda-environment.yml` may use `pip:` block for packages not on conda-forge
15+
16+
## Versioning
17+
18+
- Pin all versions — no ranges, no `>=`, no unpinned entries
19+
- `requirements.txt`: `==` (e.g. `pandas==2.2.3`)
20+
- `conda-environment.yml`: `=` (e.g. `pandas=2.2.3`)
21+
22+
## Adding or Updating
23+
24+
- **Ask user before introducing new dependencies**
25+
- Update both files when changing version
26+
27+
## Verification
28+
29+
**`requirements.txt`** — venv dry-run from [.github/workflows/internal-check-python-venv-support.yml](../../.github/workflows/internal-check-python-venv-support.yml):
30+
31+
```shell
32+
python -m venv .venv
33+
source ./scripts/activatePythonEnvironment.sh
34+
.venv/bin/pip install --dry-run --quiet --requirement requirements.txt
35+
! .venv/bin/pip install --dry-run --requirement requirements.txt 2>/dev/null | grep -q "Would install"
36+
```
37+
38+
**`conda-environment.yml`** — via [scripts/activateCondaEnvironment.sh](../../scripts/activateCondaEnvironment.sh):
39+
40+
```shell
41+
source ./scripts/activateCondaEnvironment.sh
42+
```
43+
44+
Fallback (conda directly):
45+
46+
```shell
47+
conda env update --file conda-environment.yml --prune
48+
conda activate codegraph
49+
```
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
applyTo: "**/*.py,**/*.ipynb"
3+
---
4+
# Python Conventions
5+
6+
Applies to Jupyter notebooks and standalone `.py` scripts.
7+
8+
## Style
9+
10+
- Type annotations everywhere — parameters, return types, non-obvious variables
11+
- Verify with Pylance (strict mode preferred)
12+
- No abbreviations. Write out names. `figure` not `fig`. `axis` not `ax`. `i`, `j`, `k` for indices OK
13+
- Prefer named functions over code block comments. Comments explain *why*, not *what*
14+
- Split into meaningful functions — ideally pure, easy to test
15+
- Apply basic functional programming where it improves readability (map, filter, list comprehensions)
16+
- f-strings preferred over `%` or `.format()` for string interpolation
17+
- No `+` concatenation in loops — use `"".join()` or list accumulation
18+
- `is`/`is not` for `None` comparisons, never `==`/`!=`
19+
- Truthiness: `if seq:` not `if len(seq) > 0:`; `if x is not None:` not `if x != None:`
20+
- Use `pathlib.Path` over `os.path` for file operations
21+
22+
## Type Annotations
23+
24+
- `X | None` over `Optional[X]`; `X | Y` over `Union[X, Y]` (PEP 604)
25+
- Abstract container types in signatures: `Sequence` over `list`, `Mapping` over `dict`
26+
27+
## Imports
28+
29+
- Order: stdlib → third-party → local; one blank line between groups
30+
- No wildcard imports (`from x import *`)
31+
- One import statement per module line; multiple names from same module OK: `from x import A, B`
32+
33+
## Error Handling
34+
35+
- No bare `except:` — always name specific exceptions (`except ValueError:`)
36+
- No mutable default arguments: `def f(x: list = [])` — use `None` + guard
37+
- Use `with` for all file/resource management; never manual open/close
38+
39+
## Naming
40+
41+
- No generic names — no "util", "helper", "common", "shared"
42+
- Module-level constants: `UPPER_CASE_WITH_UNDERSCORES`
43+
- DRY only for domain-related concerns
44+
- No magic numbers — extract named constants for literal comparisons
45+
46+
## Docstrings
47+
48+
- Public functions require `"""..."""` docstring (triple double quotes)
49+
- First line imperative mood, ends with period: `"""Compute distances from center."""`
50+
- Multi-line: blank line after summary, then `Args:`, `Returns:`, `Raises:` sections as needed
51+
52+
## Notebook to Script Conversion
53+
54+
- Extract charts and tables into standalone `.py` script with `main()` entry point
55+
- Original notebook → `explore/` with metadata `"code_graph_analysis_pipeline_data_validation": "ValidateAlwaysFalse"` and "Exploration" added to title
56+
- Charts → SVG, tables → CSV, descriptions → Markdown summary report
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
applyTo: "**/*.sh"
3+
---
4+
# Shell Script Conventions
5+
6+
Target: **bash**. Must work on macOS, Linux, Windows (WSL/Git Bash).
7+
8+
## Header
9+
10+
- **First line: description comment** — used by [SCRIPTS.md](../../SCRIPTS.md). Format: `# Description sentence. Requires "other_script.sh".`
11+
- Include required env vars, required tools, usage examples in description or `usage()` function
12+
- Blank line after initial comment before code starts
13+
14+
## Shebang and Strict Mode
15+
16+
- First executable line: `#!/usr/bin/env bash`
17+
- Enable strict mode immediately after: `set -euo pipefail`
18+
- Set safe word-splitting: `IFS=$'\n\t'`
19+
- `pipefail` propagates pipe failures — `set -e` bypassed in subshells and command groups; document where this applies
20+
21+
## Style
22+
23+
- POSIX-compliant as reasonable
24+
- Always `"${variable}"` — curly braces + double quotes on every expansion
25+
- Use `$(...)` for command substitution — not backticks
26+
- No abbreviations. Write out variable and function names. `i`, `j`, `k` for indices OK
27+
- Prefer named functions over code block comments. Comments explain *why*, not *what*
28+
- Split into meaningful functions — ideally pure, easy to reason about
29+
- Apply basic functional programming where it improves readability (piping, composition)
30+
31+
## Naming
32+
33+
- No generic names — no "util", "helper", "common", "shared"
34+
- DRY only for domain-related concerns. Don't extract one-off operations
35+
36+
## Variables and Scope
37+
38+
- `local` for function-scoped variables
39+
- `readonly` for constants
40+
- `${VAR:-default}` for defaults
41+
- `[[ ]]` over `[ ]`
42+
- Quote all paths: `"${directory}/${filename}"`
43+
44+
## Argument Parsing
45+
46+
- Provide `usage()` — list parameters, flags, env vars, copy-pastable examples with expected output
47+
- Support at minimum `--help` (print `usage()`, exit 0)
48+
- Support `--dry-run` for destructive or irreversible operations
49+
50+
## Dependency Checks
51+
52+
- Check required tools early: `command -v <tool> || { echo "Install <tool>: <url>"; exit 1; }`
53+
54+
## Portability
55+
56+
- Prefer POSIX idioms; guard GNU vs BSD differences explicitly
57+
- `sed -i` requires empty suffix on macOS: `sed -i ''` vs Linux `sed -i`
58+
- `date -d` GNU only — use `date -v` on macOS or detect OS and branch
59+
60+
## Error Handling and Exit Codes
61+
62+
- Trap `ERR`/`EXIT` for cleanup and meaningful error messages
63+
- Return meaningful non-zero exit codes — document semantics in `usage()`
64+
65+
## Security
66+
67+
- No `eval` — use arrays, named variables, or functions
68+
- Sanitize external inputs before use in commands or filenames
69+
- Never log or write secrets to temp files
70+
- Use `mktemp` for temp files; restrict permissions with `chmod 600` or `umask 077`
71+
- Clean up temp files in `trap ... EXIT`
72+
73+
## Linting, Formatting, and CI
74+
75+
- Verify all scripts with `shellcheck`; run in CI
76+
- Format with `shfmt`; run in CI
77+
- Document `shellcheck` exceptions inline with justification: `# shellcheck disable=SC2xxx — reason`
78+
- Test scripts: name with prefix `test` (e.g. `testMyFeature.sh`) — `runTests.sh` auto-discovers in `scripts/` and `domains/` dirs

.github/skills/caveman/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Julius Brussee
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

.github/skills/caveman/SKILL.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: caveman
3+
description: >
4+
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman
5+
while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra.
6+
Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens",
7+
"be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
8+
---
9+
10+
Respond terse like smart caveman. All technical substance stay. Only fluff die.
11+
12+
## Persistence
13+
14+
ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure. Off only: "stop caveman" / "normal mode".
15+
16+
Default: **full**. Switch: `/caveman lite|full|ultra`.
17+
18+
## Rules
19+
20+
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact.
21+
22+
Pattern: `[thing] [action] [reason]. [next step].`
23+
24+
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
25+
Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
26+
27+
## Intensity
28+
29+
| Level | What change |
30+
|-------|------------|
31+
| **lite** | No filler/hedging. Keep articles + full sentences. Professional but tight |
32+
| **full** | Drop articles, fragments OK, short synonyms. Classic caveman |
33+
| **ultra** | Abbreviate (DB/auth/config/req/res/fn/impl), strip conjunctions, arrows for causality (X → Y), one word when one word enough |
34+
35+
Example — "Why React component re-render?"
36+
- lite: "Your component re-renders because you create a new object reference each render. Wrap it in `useMemo`."
37+
- full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
38+
- ultra: "Inline obj prop → new ref → re-render. `useMemo`."
39+
40+
Example — "Explain database connection pooling."
41+
- lite: "Connection pooling reuses open connections instead of creating new ones per request. Avoids repeated handshake overhead."
42+
- full: "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
43+
- ultra: "Pool = reuse DB conn. Skip handshake → fast under load."
44+
45+
## Auto-Clarity
46+
47+
Drop caveman for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question. Resume caveman after clear part done.
48+
49+
Example — destructive op:
50+
> **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
51+
> ```sql
52+
> DROP TABLE users;
53+
> ```
54+
> Caveman resume. Verify backup exist first.
55+
56+
## Boundaries
57+
58+
Code/commits/PRs: write normal. "stop caveman" or "normal mode": revert. Level persist until changed or session end.

0 commit comments

Comments
 (0)