Skip to content

Commit edaac81

Browse files
bilersanCopilot
authored andcommitted
feat: full Copilot CLI skill parity with Claude integration
Port all 40 Claude skills to Copilot CLI format with proper YAML frontmatter (tools array instead of allowed-tools string). Includes lifecycle hook scripts (bash + PowerShell), agent instructions, and hook configuration. Contents: - 40 skill SKILL.md files under integrations/copilot-cli/skills/ - 8 hook scripts (session-start/end, pre/post-tool-use × bash/ps1) - INSTRUCTIONS.md agent bootstrap instructions - ctx-hooks.json lifecycle hook configuration - Updated embed.go to include integrations assets - Parity spec document (specs/copilot-feature-parity-kit.md) Signed-off-by: ersan bilik <ersanbilik@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ersan bilik <ersanbilik@gmail.com>
1 parent 5958e55 commit edaac81

51 files changed

Lines changed: 3337 additions & 353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# ctx Agent Instructions — Copilot CLI
2+
3+
<!-- ctx:context -->
4+
<!-- DO NOT REMOVE: This marker indicates ctx-managed content -->
5+
6+
## IMPORTANT: You Have Persistent Memory
7+
8+
This project uses Context (`ctx`) for context persistence across sessions.
9+
**Your memory is NOT ephemeral**: it lives in the context directory.
10+
11+
## On Session Start
12+
13+
1. **Run `ctx system bootstrap`**: CRITICAL, not optional.
14+
This tells you where the context directory is. If it fails or returns
15+
no context_dir, STOP and warn the user.
16+
2. **Read AGENT_PLAYBOOK.md** from the context directory: it explains
17+
how to use this system
18+
3. **Run `ctx agent --budget 4000`** for a content summary
19+
20+
## When Asked "Do You Remember?"
21+
22+
When the user asks "Do you remember?", "What were we working on?", or any
23+
memory-related question:
24+
25+
**Do this FIRST (silently):**
26+
- Read TASKS.md, DECISIONS.md, and LEARNINGS.md from the context directory
27+
- Run `ctx recall list --limit 5` for recent session history
28+
29+
**Then respond with a structured readback:**
30+
31+
1. **Last session**: cite the most recent session topic and date
32+
2. **Active work**: list pending or in-progress tasks
33+
3. **Recent context**: mention 1-2 recent decisions or learnings
34+
4. **Next step**: offer to continue or ask what to focus on
35+
36+
**Never** lead with "I don't have memory", "Let me check if there are files",
37+
or narrate your discovery process. The context files are your memory.
38+
Read them silently, then present what you found as recall, not as a search.
39+
40+
## Quick Context Load
41+
42+
```bash
43+
# Get AI-optimized context packet (what you should know)
44+
ctx agent --budget 4000
45+
46+
# Or see full status
47+
ctx status
48+
```
49+
50+
## Context Files
51+
52+
| File | Purpose |
53+
|-----------------|----------------------------------------|
54+
| CONSTITUTION.md | Hard rules — NEVER violate |
55+
| TASKS.md | Current work items |
56+
| DECISIONS.md | Architectural decisions with rationale |
57+
| LEARNINGS.md | Gotchas, tips, lessons learned |
58+
| CONVENTIONS.md | Code patterns and standards |
59+
60+
All files live in the context directory reported by `ctx system bootstrap`.
61+
62+
## Context Updates During Work
63+
64+
Proactively update context files as you work:
65+
66+
| Event | Action |
67+
|-----------------------------|-------------------------------------|
68+
| Made architectural decision | Add to `.context/DECISIONS.md` |
69+
| Discovered gotcha/bug | Add to `.context/LEARNINGS.md` |
70+
| Established new pattern | Add to `.context/CONVENTIONS.md` |
71+
| Completed task | Mark [x] in `.context/TASKS.md` |
72+
73+
## Self-Check
74+
75+
Periodically ask yourself:
76+
77+
> "If this session ended right now, would the next session know what happened?"
78+
79+
If no — save a session file or update context files before continuing.
80+
81+
## Session Persistence
82+
83+
After completing meaningful work, save a session summary to
84+
`.context/sessions/`. Use the `ctx-wrap-up` skill for the full ceremony.
85+
86+
## Build Commands
87+
88+
```bash
89+
make build # or: go build ./cmd/ctx/...
90+
make lint # or: golangci-lint run
91+
make test # or: go test ./...
92+
```
93+
94+
<!-- ctx:end -->

internal/assets/integrations/copilot-cli/ctx-hooks.json

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,68 @@
11
{
2-
"version": 1,
32
"hooks": {
43
"sessionStart": [
54
{
6-
"type": "command",
7-
"bash": ".github/hooks/scripts/ctx-sessionStart.sh",
8-
"powershell": ".github/hooks/scripts/ctx-sessionStart.ps1",
9-
"cwd": ".",
10-
"timeoutSec": 10
5+
"description": "Bootstrap ctx context on session start",
6+
"command": "ctx system bootstrap"
7+
},
8+
{
9+
"description": "Load AI-optimized context packet",
10+
"command": "ctx agent --budget 4000"
1111
}
1212
],
1313
"preToolUse": [
1414
{
15-
"type": "command",
16-
"bash": ".github/hooks/scripts/ctx-preToolUse.sh",
17-
"powershell": ".github/hooks/scripts/ctx-preToolUse.ps1",
18-
"cwd": ".",
19-
"timeoutSec": 5
15+
"description": "Context load gate — ensure context is loaded before work",
16+
"command": "ctx system context-load-gate"
17+
},
18+
{
19+
"description": "Block dangerous non-path ctx commands",
20+
"matcher": "bash",
21+
"command": "ctx system block-non-path-ctx"
22+
},
23+
{
24+
"description": "QA reminder nudge",
25+
"matcher": "bash",
26+
"command": "ctx system qa-reminder"
2027
}
2128
],
2229
"postToolUse": [
2330
{
24-
"type": "command",
25-
"bash": ".github/hooks/scripts/ctx-postToolUse.sh",
26-
"powershell": ".github/hooks/scripts/ctx-postToolUse.ps1",
27-
"cwd": ".",
28-
"timeoutSec": 5
31+
"description": "Post-commit context persistence check",
32+
"matcher": "bash",
33+
"command": "ctx system post-commit"
34+
},
35+
{
36+
"description": "Check if a task was just completed",
37+
"matcher": "edit",
38+
"command": "ctx system check-task-completion"
39+
},
40+
{
41+
"description": "Check if a task was just completed (write)",
42+
"matcher": "write",
43+
"command": "ctx system check-task-completion"
2944
}
3045
],
3146
"sessionEnd": [
3247
{
33-
"type": "command",
34-
"bash": ".github/hooks/scripts/ctx-sessionEnd.sh",
35-
"powershell": ".github/hooks/scripts/ctx-sessionEnd.ps1",
36-
"cwd": ".",
37-
"timeoutSec": 15
48+
"description": "Check context size for budget drift",
49+
"command": "ctx system check-context-size"
50+
},
51+
{
52+
"description": "Persistence check — unsaved decisions/learnings",
53+
"command": "ctx system check-persistence"
54+
},
55+
{
56+
"description": "Journal export check",
57+
"command": "ctx system check-journal"
58+
},
59+
{
60+
"description": "Version freshness check",
61+
"command": "ctx system check-version"
62+
},
63+
{
64+
"description": "Heartbeat — record session activity",
65+
"command": "ctx system heartbeat"
3866
}
3967
]
4068
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ctx post-tool-use hook for Copilot CLI (PowerShell)
2+
# Checks for post-commit context and task completion
3+
4+
$Tool = $args[0]
5+
6+
if ($Tool -eq "bash" -or $Tool -eq "powershell") {
7+
try { ctx system post-commit 2>$null } catch {}
8+
}
9+
10+
if ($Tool -eq "edit" -or $Tool -eq "write") {
11+
try { ctx system check-task-completion 2>$null } catch {}
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# ctx post-tool-use hook for Copilot CLI
3+
# Checks for post-commit context and task completion
4+
set -euo pipefail
5+
6+
TOOL="${1:-}"
7+
8+
if [ "$TOOL" = "bash" ] || [ "$TOOL" = "powershell" ]; then
9+
ctx system post-commit 2>/dev/null || true
10+
fi
11+
12+
if [ "$TOOL" = "edit" ] || [ "$TOOL" = "write" ]; then
13+
ctx system check-task-completion 2>/dev/null || true
14+
fi
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ctx pre-tool-use hook for Copilot CLI (PowerShell)
2+
# Ensures context is loaded and blocks dangerous commands
3+
4+
$Tool = $args[0]
5+
6+
try { ctx system context-load-gate 2>$null } catch {}
7+
8+
if ($Tool -eq "bash" -or $Tool -eq "powershell") {
9+
try { ctx system block-non-path-ctx 2>$null } catch {}
10+
try { ctx system qa-reminder 2>$null } catch {}
11+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# ctx pre-tool-use hook for Copilot CLI
3+
# Ensures context is loaded and blocks dangerous commands
4+
set -euo pipefail
5+
6+
TOOL="${1:-}"
7+
8+
# Always check context load gate
9+
ctx system context-load-gate 2>/dev/null || true
10+
11+
# Bash-specific hooks
12+
if [ "$TOOL" = "bash" ] || [ "$TOOL" = "powershell" ]; then
13+
ctx system block-non-path-ctx 2>/dev/null || true
14+
ctx system qa-reminder 2>/dev/null || true
15+
fi
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ctx session end hook for Copilot CLI (PowerShell)
2+
# Checks for unsaved context and records heartbeat
3+
4+
try { ctx system check-context-size 2>$null } catch {}
5+
try { ctx system check-persistence 2>$null } catch {}
6+
try { ctx system check-journal 2>$null } catch {}
7+
try { ctx system check-version 2>$null } catch {}
8+
try { ctx system heartbeat 2>$null } catch {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# ctx session end hook for Copilot CLI
3+
# Checks for unsaved context and records heartbeat
4+
set -euo pipefail
5+
6+
ctx system check-context-size 2>/dev/null || true
7+
ctx system check-persistence 2>/dev/null || true
8+
ctx system check-journal 2>/dev/null || true
9+
ctx system check-version 2>/dev/null || true
10+
ctx system heartbeat 2>/dev/null || true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ctx session start hook for Copilot CLI (PowerShell)
2+
# Bootstraps context and loads the agent packet
3+
4+
try { ctx system bootstrap 2>$null } catch {}
5+
try { ctx agent --budget 4000 2>$null } catch {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# ctx session start hook for Copilot CLI
3+
# Bootstraps context and loads the agent packet
4+
set -euo pipefail
5+
6+
# Bootstrap ctx context
7+
ctx system bootstrap 2>/dev/null || true
8+
9+
# Load AI-optimized context packet
10+
ctx agent --budget 4000 2>/dev/null || true

0 commit comments

Comments
 (0)