@vesviet/agent-skills 5.6.0 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +1 -1
- package/README.md +1 -1
- package/VERSION +1 -1
- package/adapters/antigravity/a2a-config.template.yaml +1 -1
- package/adapters/antigravity/role-skill-index.json +1 -1
- package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
- package/adapters/cursor/README.md +185 -185
- package/bin/agent-skills.mjs +17 -14
- package/core/contracts/schemas/api-contract-spec.json +191 -191
- package/core/contracts/schemas/feature-ticket.json +1293 -1293
- package/core/contracts/schemas/pull-request-spec.json +338 -338
- package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
- package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
- package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
- package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
- package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
- package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
- package/core/contracts/schemas/test-report.json +530 -530
- package/core/roles/references/business-analyst-responsibilities.md +207 -207
- package/core/roles/references/frontend-developer-responsibilities.md +275 -275
- package/core/roles/system-engineer.md +465 -465
- package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
- package/core/skills/backend/build-mcp-server/SKILL.md +100 -100
- package/core/skills/backend/implement-structured-outputs/SKILL.md +94 -94
- package/core/skills/business/elicit-requirements/SKILL.md +102 -102
- package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
- package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
- package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
- package/core/skills/business/write-use-cases/SKILL.md +106 -106
- package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
- package/core/skills/document/pptx/scripts/add_slide.py +0 -0
- package/core/skills/document/pptx/scripts/clean.py +0 -0
- package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
- package/core/skills/document/xlsx/scripts/recalc.py +0 -0
- package/core/skills/documentation/write-documentation/SKILL.md +143 -143
- package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
- package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
- package/core/skills/foundation/release-notes/SKILL.md +192 -192
- package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
- package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
- package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
- package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
- package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
- package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
- package/core/skills/platform/setup-gpu-finops/SKILL.md +107 -107
- package/core/skills/platform/setup-llm-gateway/SKILL.md +108 -108
- package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
- package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
- package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
- package/core/skills/platform/web-perf/SKILL.md +151 -151
- package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
- package/core/skills/product/build-story-map/SKILL.md +104 -104
- package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
- package/core/skills/product/define-product-strategy/SKILL.md +105 -105
- package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
- package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
- package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
- package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
- package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
- package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
- package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
- package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
- package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
- package/core/skills/repo-ops/review-service/SKILL.md +186 -186
- package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
- package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
- package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
- package/core/skills/security-data/security-audit/SKILL.md +119 -119
- package/core/workflows/add-new-feature.md +212 -212
- package/core/workflows/agent-a2a-delegation.md +142 -142
- package/core/workflows/bug-fix.md +147 -147
- package/core/workflows/build-deploy.md +208 -208
- package/core/workflows/code-review.md +137 -137
- package/core/workflows/dependency-upgrade.md +193 -193
- package/core/workflows/feature-delivery.md +149 -149
- package/core/workflows/hotfix-production.md +172 -172
- package/core/workflows/qa-validation.md +231 -231
- package/core/workflows/refactoring.md +154 -154
- package/core/workflows/revert-deployment.md +147 -147
- package/core/workflows/security-incident-response.md +191 -191
- package/core/workflows/seo-content-lifecycle.md +91 -91
- package/core/workflows/service-review-release.md +223 -223
- package/core/workflows/setup-new-service.md +214 -214
- package/core/workflows/tech-repo-review.md +245 -245
- package/core/workflows/troubleshooting.md +241 -241
- package/overlays/astro-cloudflare/README.md +93 -93
- package/overlays/data-analyst-stack/README.md +109 -109
- package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
- package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
- package/overlays/ecommerce-microservices/README.md +65 -65
- package/overlays/go-microservices/README.md +78 -78
- package/overlays/go-microservices/rules/go-conventions.md +223 -223
- package/overlays/laravel-filament/README.md +90 -90
- package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
- package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
- package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
- package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
- package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
- package/overlays/r3f-stack/README.md +89 -89
- package/overlays/r3f-stack/rules/stub.md +43 -43
- package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
- package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
- package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
- package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
- package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
- package/package.json +2 -2
- package/core/README.md +0 -53
package/INDEX.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent-Skills Master Index & Router
|
|
2
2
|
|
|
3
|
-
> **Location:** `core/` & `overlays/` | **Version:** `5.6.
|
|
3
|
+
> **Location:** `core/` & `overlays/` | **Version:** `5.6.1` (A2A 1.0 + Antigravity)
|
|
4
4
|
> **Total Catalog:** **38 Roles** | **182 Skills** (167 Core + 15 Overlays) | **25 Workflows** | **60 Data Contracts**
|
|
5
5
|
|
|
6
6
|
---
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Skills — Engineering & Multi-Agent Pack
|
|
2
2
|
|
|
3
|
-
**Version 5.6.
|
|
3
|
+
**Version 5.6.1** · Portable engineering standards, principal-level agent roles, modular skills, structured data contracts, and end-to-end workflows for AI coding assistants and autonomous multi-agent swarms.
|
|
4
4
|
|
|
5
5
|
> **Catalog**: **38 Roles** · **182 Skills** (167 Core + 15 Overlays) · **25 Workflows** · **60 JSON Schemas** · **17 Team Packs** · **21 Overlays**
|
|
6
6
|
> **Navigation**: [Master Index (`INDEX.md`)](INDEX.md) · [Machine Registry (`role-skill-index.json`)](core/a2a/.well-known/role-skill-index.json) · [Contributing Guide](CONTRIBUTING.md) · [Changelog](CHANGELOG.md)
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.6.
|
|
1
|
+
5.6.1
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Use this adapter when running **Claude Code** (`claude` CLI or Claude Code IDE extension) with the agent-skills engineering pack.
|
|
4
4
|
|
|
5
|
-
Pack version: **5.6.
|
|
5
|
+
Pack version: **5.6.1** | A2A: **1.0** | OWASP ASI: **2026**
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
# Cursor / Kiro Adapter — Agent Skills Pack
|
|
2
|
-
|
|
3
|
-
## Files
|
|
4
|
-
|
|
5
|
-
| File | Purpose |
|
|
6
|
-
|------|---------|
|
|
7
|
-
| [`hooks.template.json`](hooks.template.json) | Cursor-format hook template — copy to `.cursor/hooks.json` and adjust paths |
|
|
8
|
-
| Pack rules | `.cursor/rules/agent-skills.md` (always-on `.mdc` rule mirror) |
|
|
9
|
-
|
|
10
|
-
> **`.cursorrules` is deprecated** as of Cursor late 2025. Migrate to `.cursor/rules/*.mdc` with YAML frontmatter. The static `.cursorrules` file is no longer read by current Cursor versions.
|
|
11
|
-
|
|
12
|
-
The pack also ships **Kiro-native hooks** at `.kiro/hooks/` (see Kiro section below).
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## `.mdc` Rules Format (2026)
|
|
17
|
-
|
|
18
|
-
Rules live in `.cursor/rules/*.mdc` with YAML frontmatter:
|
|
19
|
-
|
|
20
|
-
```markdown
|
|
21
|
-
---
|
|
22
|
-
description: "Brief description of when to apply this rule"
|
|
23
|
-
globs: ["internal/**/*.go", "api/**/*.proto"]
|
|
24
|
-
alwaysApply: false
|
|
25
|
-
---
|
|
26
|
-
# Rule content here
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
**Activation modes:**
|
|
30
|
-
|
|
31
|
-
| Mode | Frontmatter | Behavior |
|
|
32
|
-
|------|-------------|----------|
|
|
33
|
-
| Always Apply | `alwaysApply: true` | Injected into every chat session |
|
|
34
|
-
| Auto Attached | `alwaysApply: false` + `globs:` | Injected when working on matching files |
|
|
35
|
-
| Agent Requested | `description:` only (no `globs`) | AI decides to use based on description |
|
|
36
|
-
| Manual | None | User invokes with `@rule-name` |
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Cursor Setup
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
# Already done for agent-skills repo itself:
|
|
44
|
-
# .cursor/hooks.json ← instantiated from this template
|
|
45
|
-
|
|
46
|
-
# For other projects using this pack:
|
|
47
|
-
mkdir -p .cursor
|
|
48
|
-
cp adapters/cursor/hooks.template.json .cursor/hooks.json
|
|
49
|
-
# Edit AGENT_SKILLS_ROOT to the absolute path of this pack checkout
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### What the hooks do
|
|
53
|
-
|
|
54
|
-
| Hook event | Action | Effect |
|
|
55
|
-
|------------|--------|--------|
|
|
56
|
-
| `sessionStart` | `echo` reminder | Prompt to load `core/rules/code.md` |
|
|
57
|
-
| `beforeReadFile` | `check-policy.py` | Blocks reads on sensitive file patterns (`.env`, `*.pem`, `*.key`) |
|
|
58
|
-
| `preToolUse` | `check-policy.py` | Blocks `requires_approval` (exit 2) and `denied` (exit 1) write/delete actions |
|
|
59
|
-
| `beforeShellExecution` | `check-policy.py` | Policy check for all shell commands — use instead of `preToolUse` for newer Cursor |
|
|
60
|
-
| `beforeMCPExecution` | `check-policy.py` | Same check for MCP tool calls |
|
|
61
|
-
| `afterFileEdit` | `log-trace-span.py` | Appends JSONL span for file modifications |
|
|
62
|
-
| `beforeSubmitPrompt` | `check-policy.py` | Final policy advisory before prompt submission |
|
|
63
|
-
| `postToolUse` | `log-trace-span.py` | Appends JSONL span to `core/observability/spans/` |
|
|
64
|
-
| `stop` | `log-trace-span.py` | Flush trace on agent stop |
|
|
65
|
-
| `sessionEnd` | `log-trace-span.py` | Final trace flush on session close |
|
|
66
|
-
|
|
67
|
-
> **Enforcement note:** Hooks **block** agent actions via non-zero exit codes. `.mdc` rules only suggest — hooks enforce. Keep `check-policy.py` exit-code semantics: 0=allowed, 1=denied, 2=requires_approval.
|
|
68
|
-
|
|
69
|
-
### Environment variables used
|
|
70
|
-
|
|
71
|
-
| Variable | Default | Purpose |
|
|
72
|
-
|----------|---------|---------|
|
|
73
|
-
| `AGENT_SKILLS_ROOT` | auto-detected | Absolute path to this pack |
|
|
74
|
-
| `AGENT_ACTIVE_ROLE` | `agent-coordinator` | Current role slug for policy check |
|
|
75
|
-
| `AGENT_TRACE_ID` | `""` (auto UUID) | Trace correlation ID for span grouping |
|
|
76
|
-
| `OTEL_SEMCONV_STABILITY_OPT_IN` | `genai` | Enable OTel GenAI semantic conventions |
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Kiro Setup
|
|
81
|
-
|
|
82
|
-
Kiro hooks live at `.kiro/hooks/*.json` and use Kiro's native hook format.
|
|
83
|
-
|
|
84
|
-
The pack ships 3 hooks under `.kiro/hooks/`:
|
|
85
|
-
|
|
86
|
-
| File | Trigger | Action |
|
|
87
|
-
|------|---------|--------|
|
|
88
|
-
| `role-gate.json` | `preTaskExecution` | Remind agent to load rules + role + policy before acting |
|
|
89
|
-
| `policy-check.json` | `preToolUse` (write, shell) | Run `check-policy.py` enforcement check |
|
|
90
|
-
| `trace-span.json` | `postToolUse` (*) | Append trace span JSONL |
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
# Copy to your project (or symlink):
|
|
94
|
-
mkdir -p /your-project/.kiro/hooks
|
|
95
|
-
cp /path/to/agent-skills/.kiro/hooks/*.json /your-project/.kiro/hooks/
|
|
96
|
-
# Edit AGENT_SKILLS_ROOT in policy-check.json and trace-span.json
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Or use the Kiro Hook UI (`Open Kiro Hook UI` in command palette) to add individually.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Policy enforcement logic
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
preToolUse / beforeMCPExecution
|
|
107
|
-
│
|
|
108
|
-
├── check destructive_patterns (mcp-tool-map.yaml) by command substring
|
|
109
|
-
├── lookup tool name in tool_actions map
|
|
110
|
-
└── fallback to keyword inference
|
|
111
|
-
│
|
|
112
|
-
├── action in role.denied → exit 1 (POLICY DENIED)
|
|
113
|
-
├── action in role.requires_approval → exit 2 (POLICY APPROVAL REQUIRED)
|
|
114
|
-
└── action in role.allowed → silent pass, exit 0
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Script: `core/scripts/hooks/check-policy.py`
|
|
118
|
-
Policy: `core/policies/action-boundaries.yaml`
|
|
119
|
-
Tool map: `core/policies/mcp-tool-map.yaml`
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## A2A + Antigravity + Claude
|
|
124
|
-
|
|
125
|
-
Cursor, Kiro, and Claude Code share the same pack contracts. For A2A registry and Antigravity-specific config, also use [`../antigravity/ANTIGRAVITY.md`](../antigravity/ANTIGRAVITY.md). For Claude Code setup, see [`../claude/CLAUDE_ADAPTER.md`](../claude/CLAUDE_ADAPTER.md).
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
# Antigravity quick setup:
|
|
129
|
-
mkdir -p .antigravity
|
|
130
|
-
cp adapters/antigravity/rules.template.md .antigravity/rules.md
|
|
131
|
-
cp adapters/antigravity/a2a-config.template.yaml .antigravity/a2a-config.yaml
|
|
132
|
-
python3 core/scripts/generate-a2a-registry.py
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## Verify setup
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
# Run from the pack root so AGENT_SKILLS_ROOT resolves to it:
|
|
141
|
-
# Test check-policy.py directly:
|
|
142
|
-
AGENT_SKILLS_ROOT="$PWD" \
|
|
143
|
-
AGENT_ACTIVE_ROLE=backend-developer \
|
|
144
|
-
CURSOR_TOOL_NAME=write_file \
|
|
145
|
-
python3 core/scripts/hooks/check-policy.py
|
|
146
|
-
|
|
147
|
-
# Test trace span:
|
|
148
|
-
AGENT_SKILLS_ROOT="$PWD" \
|
|
149
|
-
AGENT_ACTIVE_ROLE=agent-coordinator \
|
|
150
|
-
python3 core/scripts/hooks/log-trace-span.py
|
|
151
|
-
|
|
152
|
-
# Run full A2A compliance check:
|
|
153
|
-
python3 core/scripts/validate-a2a-compliance.py
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## Standard 2026 Alignment
|
|
157
|
-
|
|
158
|
-
This adapter preserves every parity group in `core/adapter-parity.md`. The
|
|
159
|
-
2026 upgrade pass added Failure Modes, Output Contracts, and Security
|
|
160
|
-
Guardrails to match the rest of the pack.
|
|
161
|
-
|
|
162
|
-
### Failure Modes
|
|
163
|
-
|
|
164
|
-
- **`.cursorrules` re-introduced by copy-paste**: a developer copies the deprecated `.cursorrules` path back into a project. **Mitigation:** the `.mdc` rules format is the only supported format as of late 2025; surface the deprecation in PR review and reject the change.
|
|
165
|
-
- **Hook exit-code semantics regress**: a future Cursor version changes the meaning of non-zero exit codes in `beforeReadFile` or `preToolUse`. **Mitigation:** the `check-policy.py` exit-code contract (0=allowed, 1=denied, 2=requires_approval) is documented in the Enforcement note; downstream scripts must remain consistent.
|
|
166
|
-
- **Hook does not call `check-policy.py`**: a hook calls a different script or skips the policy check. **Mitigation:** every state-changing hook (write, delete, shell, MCP) must route through `core/scripts/hooks/check-policy.py`; reject the hook if the script is missing.
|
|
167
|
-
- **AGENT_SKILLS_ROOT unresolved**: a hook fires before `AGENT_SKILLS_ROOT` is set, returning a fallback verdict. **Mitigation:** every hook must validate the env var at startup and exit non-zero with a clear error when the pack root is missing.
|
|
168
|
-
- **Trace span log drifts from the live OTel GenAI convention**: a `log-trace-span.py` invocation uses deprecated `prompt_tokens` / `completion_tokens` instead of `gen_ai.usage.input_tokens` / `output_tokens`. **Mitigation:** the script follows `core/observability/otel-genai.md`; reject any span attribute that is not in the OTel registry.
|
|
169
|
-
|
|
170
|
-
### Output Contracts
|
|
171
|
-
|
|
172
|
-
When this adapter is part of a coordinated multi-role delivery, emit:
|
|
173
|
-
|
|
174
|
-
- **`contracts/schemas/implementation-result.json`** for the result of any agent session that touched code, skills, or content.
|
|
175
|
-
- **`contracts/schemas/incident-report.json`** when a hook blocks an action.
|
|
176
|
-
- **`contracts/schemas/api-contract-spec.json`** for new `.mdc` rules that change the public agent surface.
|
|
177
|
-
|
|
178
|
-
### Security Guardrails (OWASP ASI)
|
|
179
|
-
|
|
180
|
-
- **ASI01 Goal Hijack**: hook inputs are untrusted; `beforeSubmitPrompt` must re-validate the prompt against the active role's goal before allowing submission.
|
|
181
|
-
- **ASI03 Identity & Privilege Abuse**: `preToolUse` and `beforeMCPExecution` must enforce role-based action boundaries via `action-boundaries.yaml`.
|
|
182
|
-
- **ASI05 RCE Guard**: `beforeShellExecution` and `beforeMCPExecution` must schema-validate every command and tool input before dispatch.
|
|
183
|
-
- **ASI07 Inter-Agent Communication**: the trace span log is a cross-agent surface; emit `gen_ai.*` attributes per the OTel GenAI semantic conventions.
|
|
184
|
-
- **ASI09 Human-Agent Trust Exploitation**: `requires_approval` (exit 2) must pause and surface a clear message; never auto-approve.
|
|
185
|
-
|
|
1
|
+
# Cursor / Kiro Adapter — Agent Skills Pack
|
|
2
|
+
|
|
3
|
+
## Files
|
|
4
|
+
|
|
5
|
+
| File | Purpose |
|
|
6
|
+
|------|---------|
|
|
7
|
+
| [`hooks.template.json`](hooks.template.json) | Cursor-format hook template — copy to `.cursor/hooks.json` and adjust paths |
|
|
8
|
+
| Pack rules | `.cursor/rules/agent-skills.md` (always-on `.mdc` rule mirror) |
|
|
9
|
+
|
|
10
|
+
> **`.cursorrules` is deprecated** as of Cursor late 2025. Migrate to `.cursor/rules/*.mdc` with YAML frontmatter. The static `.cursorrules` file is no longer read by current Cursor versions.
|
|
11
|
+
|
|
12
|
+
The pack also ships **Kiro-native hooks** at `.kiro/hooks/` (see Kiro section below).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## `.mdc` Rules Format (2026)
|
|
17
|
+
|
|
18
|
+
Rules live in `.cursor/rules/*.mdc` with YAML frontmatter:
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
---
|
|
22
|
+
description: "Brief description of when to apply this rule"
|
|
23
|
+
globs: ["internal/**/*.go", "api/**/*.proto"]
|
|
24
|
+
alwaysApply: false
|
|
25
|
+
---
|
|
26
|
+
# Rule content here
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Activation modes:**
|
|
30
|
+
|
|
31
|
+
| Mode | Frontmatter | Behavior |
|
|
32
|
+
|------|-------------|----------|
|
|
33
|
+
| Always Apply | `alwaysApply: true` | Injected into every chat session |
|
|
34
|
+
| Auto Attached | `alwaysApply: false` + `globs:` | Injected when working on matching files |
|
|
35
|
+
| Agent Requested | `description:` only (no `globs`) | AI decides to use based on description |
|
|
36
|
+
| Manual | None | User invokes with `@rule-name` |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Cursor Setup
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Already done for agent-skills repo itself:
|
|
44
|
+
# .cursor/hooks.json ← instantiated from this template
|
|
45
|
+
|
|
46
|
+
# For other projects using this pack:
|
|
47
|
+
mkdir -p .cursor
|
|
48
|
+
cp adapters/cursor/hooks.template.json .cursor/hooks.json
|
|
49
|
+
# Edit AGENT_SKILLS_ROOT to the absolute path of this pack checkout
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### What the hooks do
|
|
53
|
+
|
|
54
|
+
| Hook event | Action | Effect |
|
|
55
|
+
|------------|--------|--------|
|
|
56
|
+
| `sessionStart` | `echo` reminder | Prompt to load `core/rules/code.md` |
|
|
57
|
+
| `beforeReadFile` | `check-policy.py` | Blocks reads on sensitive file patterns (`.env`, `*.pem`, `*.key`) |
|
|
58
|
+
| `preToolUse` | `check-policy.py` | Blocks `requires_approval` (exit 2) and `denied` (exit 1) write/delete actions |
|
|
59
|
+
| `beforeShellExecution` | `check-policy.py` | Policy check for all shell commands — use instead of `preToolUse` for newer Cursor |
|
|
60
|
+
| `beforeMCPExecution` | `check-policy.py` | Same check for MCP tool calls |
|
|
61
|
+
| `afterFileEdit` | `log-trace-span.py` | Appends JSONL span for file modifications |
|
|
62
|
+
| `beforeSubmitPrompt` | `check-policy.py` | Final policy advisory before prompt submission |
|
|
63
|
+
| `postToolUse` | `log-trace-span.py` | Appends JSONL span to `core/observability/spans/` |
|
|
64
|
+
| `stop` | `log-trace-span.py` | Flush trace on agent stop |
|
|
65
|
+
| `sessionEnd` | `log-trace-span.py` | Final trace flush on session close |
|
|
66
|
+
|
|
67
|
+
> **Enforcement note:** Hooks **block** agent actions via non-zero exit codes. `.mdc` rules only suggest — hooks enforce. Keep `check-policy.py` exit-code semantics: 0=allowed, 1=denied, 2=requires_approval.
|
|
68
|
+
|
|
69
|
+
### Environment variables used
|
|
70
|
+
|
|
71
|
+
| Variable | Default | Purpose |
|
|
72
|
+
|----------|---------|---------|
|
|
73
|
+
| `AGENT_SKILLS_ROOT` | auto-detected | Absolute path to this pack |
|
|
74
|
+
| `AGENT_ACTIVE_ROLE` | `agent-coordinator` | Current role slug for policy check |
|
|
75
|
+
| `AGENT_TRACE_ID` | `""` (auto UUID) | Trace correlation ID for span grouping |
|
|
76
|
+
| `OTEL_SEMCONV_STABILITY_OPT_IN` | `genai` | Enable OTel GenAI semantic conventions |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Kiro Setup
|
|
81
|
+
|
|
82
|
+
Kiro hooks live at `.kiro/hooks/*.json` and use Kiro's native hook format.
|
|
83
|
+
|
|
84
|
+
The pack ships 3 hooks under `.kiro/hooks/`:
|
|
85
|
+
|
|
86
|
+
| File | Trigger | Action |
|
|
87
|
+
|------|---------|--------|
|
|
88
|
+
| `role-gate.json` | `preTaskExecution` | Remind agent to load rules + role + policy before acting |
|
|
89
|
+
| `policy-check.json` | `preToolUse` (write, shell) | Run `check-policy.py` enforcement check |
|
|
90
|
+
| `trace-span.json` | `postToolUse` (*) | Append trace span JSONL |
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Copy to your project (or symlink):
|
|
94
|
+
mkdir -p /your-project/.kiro/hooks
|
|
95
|
+
cp /path/to/agent-skills/.kiro/hooks/*.json /your-project/.kiro/hooks/
|
|
96
|
+
# Edit AGENT_SKILLS_ROOT in policy-check.json and trace-span.json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Or use the Kiro Hook UI (`Open Kiro Hook UI` in command palette) to add individually.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Policy enforcement logic
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
preToolUse / beforeMCPExecution
|
|
107
|
+
│
|
|
108
|
+
├── check destructive_patterns (mcp-tool-map.yaml) by command substring
|
|
109
|
+
├── lookup tool name in tool_actions map
|
|
110
|
+
└── fallback to keyword inference
|
|
111
|
+
│
|
|
112
|
+
├── action in role.denied → exit 1 (POLICY DENIED)
|
|
113
|
+
├── action in role.requires_approval → exit 2 (POLICY APPROVAL REQUIRED)
|
|
114
|
+
└── action in role.allowed → silent pass, exit 0
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Script: `core/scripts/hooks/check-policy.py`
|
|
118
|
+
Policy: `core/policies/action-boundaries.yaml`
|
|
119
|
+
Tool map: `core/policies/mcp-tool-map.yaml`
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## A2A + Antigravity + Claude
|
|
124
|
+
|
|
125
|
+
Cursor, Kiro, and Claude Code share the same pack contracts. For A2A registry and Antigravity-specific config, also use [`../antigravity/ANTIGRAVITY.md`](../antigravity/ANTIGRAVITY.md). For Claude Code setup, see [`../claude/CLAUDE_ADAPTER.md`](../claude/CLAUDE_ADAPTER.md).
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Antigravity quick setup:
|
|
129
|
+
mkdir -p .antigravity
|
|
130
|
+
cp adapters/antigravity/rules.template.md .antigravity/rules.md
|
|
131
|
+
cp adapters/antigravity/a2a-config.template.yaml .antigravity/a2a-config.yaml
|
|
132
|
+
python3 core/scripts/generate-a2a-registry.py
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Verify setup
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Run from the pack root so AGENT_SKILLS_ROOT resolves to it:
|
|
141
|
+
# Test check-policy.py directly:
|
|
142
|
+
AGENT_SKILLS_ROOT="$PWD" \
|
|
143
|
+
AGENT_ACTIVE_ROLE=backend-developer \
|
|
144
|
+
CURSOR_TOOL_NAME=write_file \
|
|
145
|
+
python3 core/scripts/hooks/check-policy.py
|
|
146
|
+
|
|
147
|
+
# Test trace span:
|
|
148
|
+
AGENT_SKILLS_ROOT="$PWD" \
|
|
149
|
+
AGENT_ACTIVE_ROLE=agent-coordinator \
|
|
150
|
+
python3 core/scripts/hooks/log-trace-span.py
|
|
151
|
+
|
|
152
|
+
# Run full A2A compliance check:
|
|
153
|
+
python3 core/scripts/validate-a2a-compliance.py
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Standard 2026 Alignment
|
|
157
|
+
|
|
158
|
+
This adapter preserves every parity group in `core/adapter-parity.md`. The
|
|
159
|
+
2026 upgrade pass added Failure Modes, Output Contracts, and Security
|
|
160
|
+
Guardrails to match the rest of the pack.
|
|
161
|
+
|
|
162
|
+
### Failure Modes
|
|
163
|
+
|
|
164
|
+
- **`.cursorrules` re-introduced by copy-paste**: a developer copies the deprecated `.cursorrules` path back into a project. **Mitigation:** the `.mdc` rules format is the only supported format as of late 2025; surface the deprecation in PR review and reject the change.
|
|
165
|
+
- **Hook exit-code semantics regress**: a future Cursor version changes the meaning of non-zero exit codes in `beforeReadFile` or `preToolUse`. **Mitigation:** the `check-policy.py` exit-code contract (0=allowed, 1=denied, 2=requires_approval) is documented in the Enforcement note; downstream scripts must remain consistent.
|
|
166
|
+
- **Hook does not call `check-policy.py`**: a hook calls a different script or skips the policy check. **Mitigation:** every state-changing hook (write, delete, shell, MCP) must route through `core/scripts/hooks/check-policy.py`; reject the hook if the script is missing.
|
|
167
|
+
- **AGENT_SKILLS_ROOT unresolved**: a hook fires before `AGENT_SKILLS_ROOT` is set, returning a fallback verdict. **Mitigation:** every hook must validate the env var at startup and exit non-zero with a clear error when the pack root is missing.
|
|
168
|
+
- **Trace span log drifts from the live OTel GenAI convention**: a `log-trace-span.py` invocation uses deprecated `prompt_tokens` / `completion_tokens` instead of `gen_ai.usage.input_tokens` / `output_tokens`. **Mitigation:** the script follows `core/observability/otel-genai.md`; reject any span attribute that is not in the OTel registry.
|
|
169
|
+
|
|
170
|
+
### Output Contracts
|
|
171
|
+
|
|
172
|
+
When this adapter is part of a coordinated multi-role delivery, emit:
|
|
173
|
+
|
|
174
|
+
- **`contracts/schemas/implementation-result.json`** for the result of any agent session that touched code, skills, or content.
|
|
175
|
+
- **`contracts/schemas/incident-report.json`** when a hook blocks an action.
|
|
176
|
+
- **`contracts/schemas/api-contract-spec.json`** for new `.mdc` rules that change the public agent surface.
|
|
177
|
+
|
|
178
|
+
### Security Guardrails (OWASP ASI)
|
|
179
|
+
|
|
180
|
+
- **ASI01 Goal Hijack**: hook inputs are untrusted; `beforeSubmitPrompt` must re-validate the prompt against the active role's goal before allowing submission.
|
|
181
|
+
- **ASI03 Identity & Privilege Abuse**: `preToolUse` and `beforeMCPExecution` must enforce role-based action boundaries via `action-boundaries.yaml`.
|
|
182
|
+
- **ASI05 RCE Guard**: `beforeShellExecution` and `beforeMCPExecution` must schema-validate every command and tool input before dispatch.
|
|
183
|
+
- **ASI07 Inter-Agent Communication**: the trace span log is a cross-agent surface; emit `gen_ai.*` attributes per the OTel GenAI semantic conventions.
|
|
184
|
+
- **ASI09 Human-Agent Trust Exploitation**: `requires_approval` (exit 2) must pause and surface a clear message; never auto-approve.
|
|
185
|
+
|
|
186
186
|
Last updated: 2026-09-01
|
package/bin/agent-skills.mjs
CHANGED
|
@@ -88,25 +88,28 @@ async function listMarkdown(dir, exclude) {
|
|
|
88
88
|
if (!(await fileExists(dir))) return [];
|
|
89
89
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
90
90
|
return entries
|
|
91
|
-
.filter((e) => e.isFile() && e.name.endsWith(".md")
|
|
91
|
+
.filter((e) => e.isFile() && e.name.endsWith(".md"))
|
|
92
92
|
.map((e) => e.name.replace(/\.md$/, ""))
|
|
93
|
+
.filter((name) => !exclude.includes(name))
|
|
93
94
|
.sort();
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
function parseArgs(argv) {
|
|
97
|
-
|
|
98
|
+
let command;
|
|
98
99
|
const flags = {};
|
|
99
|
-
for (let i = 0; i <
|
|
100
|
-
const arg =
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
} else if (["--taxonomy", "--skill", "--target", "--path"].includes(arg)) {
|
|
104
|
-
const value = rest[i + 1];
|
|
100
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
101
|
+
const arg = argv[i];
|
|
102
|
+
if (["--taxonomy", "--skill", "--target", "--path"].includes(arg)) {
|
|
103
|
+
const value = argv[i + 1];
|
|
105
104
|
if (value === undefined || value.startsWith("--")) {
|
|
106
105
|
throw new UsageError(`missing value for ${arg}`);
|
|
107
106
|
}
|
|
108
107
|
flags[arg] = value;
|
|
109
108
|
i += 1;
|
|
109
|
+
} else if (arg === "--json" || arg === "--help" || arg === "--version") {
|
|
110
|
+
flags[arg] = true;
|
|
111
|
+
} else if (command === undefined && !arg.startsWith("--")) {
|
|
112
|
+
command = arg;
|
|
110
113
|
} else {
|
|
111
114
|
throw new UsageError(`unknown argument: ${arg}`);
|
|
112
115
|
}
|
|
@@ -124,8 +127,8 @@ async function cmdList(flags) {
|
|
|
124
127
|
const skills = (await listSkills()).filter(
|
|
125
128
|
(s) => !taxonomies || taxonomies.includes(s.taxonomy) || taxonomies.includes(s.source)
|
|
126
129
|
);
|
|
127
|
-
const roles = taxonomies ? [] : await listMarkdown(ROLES_DIR, ["README", "role-standard"]);
|
|
128
|
-
const workflows = taxonomies ? [] : await listMarkdown(WORKFLOWS_DIR, ["README"]);
|
|
130
|
+
const roles = taxonomies ? [] : await listMarkdown(ROLES_DIR, ["README", "role-standard", "INDEX"]);
|
|
131
|
+
const workflows = taxonomies ? [] : await listMarkdown(WORKFLOWS_DIR, ["README", "INDEX"]);
|
|
129
132
|
|
|
130
133
|
if (flags["--json"]) {
|
|
131
134
|
process.stdout.write(
|
|
@@ -213,14 +216,14 @@ async function cmdInstall(flags) {
|
|
|
213
216
|
|
|
214
217
|
async function main() {
|
|
215
218
|
const { command, flags } = parseArgs(process.argv.slice(2));
|
|
216
|
-
if (flags["--help"] || command === "help" || command === undefined) {
|
|
217
|
-
process.stdout.write(USAGE);
|
|
218
|
-
return command === undefined && !flags["--help"] ? 2 : 0;
|
|
219
|
-
}
|
|
220
219
|
if (flags["--version"] || command === "version") {
|
|
221
220
|
process.stdout.write(`${await packVersion()}\n`);
|
|
222
221
|
return 0;
|
|
223
222
|
}
|
|
223
|
+
if (flags["--help"] || command === "help" || command === undefined) {
|
|
224
|
+
process.stdout.write(USAGE);
|
|
225
|
+
return command === undefined && !flags["--help"] ? 2 : 0;
|
|
226
|
+
}
|
|
224
227
|
if (command === "list") return cmdList(flags);
|
|
225
228
|
if (command === "install") return cmdInstall(flags);
|
|
226
229
|
throw new UsageError(`unknown command: ${command}`);
|