@aegis-scan/skills 0.2.0 → 0.4.0
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/ATTRIBUTION.md +60 -4
- package/CHANGELOG.md +78 -0
- package/README.md +27 -0
- package/dist/bin.js +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +9 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/skills-loader.d.ts +43 -0
- package/dist/skills-loader.d.ts.map +1 -1
- package/dist/skills-loader.js +102 -0
- package/dist/skills-loader.js.map +1 -1
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
- package/skills/compliance/_INDEX.md +49 -0
- package/skills/compliance/aegis-native/brutaler-anwalt/SKILL.md +100 -3
- package/skills/defensive/aegis-native/rls-defense/SKILL.md +25 -0
- package/skills/defensive/aegis-native/tenant-isolation-defense/SKILL.md +26 -0
- package/skills/foundation/_INDEX.md +73 -0
- package/skills/foundation/aegis-native/aegis-audit/SKILL.md +194 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-1-headers.md +138 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-2-html.md +153 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-3-impressum.md +159 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-4-dse.md +178 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-5-cookie.md +180 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-6-branche.md +204 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-7-code-cross-check.md +212 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-8-schadens-diagnose.md +232 -0
- package/skills/foundation/aegis-native/aegis-customer-build/SKILL.md +232 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-1-recon.md +147 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-2-architecture.md +164 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-3-component-build.md +231 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-4-content.md +196 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-5-integration.md +273 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-6-mid-audit.md +200 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-7-final-verify.md +258 -0
- package/skills/foundation/aegis-native/aegis-handover-writer/SKILL.md +128 -0
- package/skills/foundation/aegis-native/aegis-module-builder/SKILL.md +251 -0
- package/skills/foundation/aegis-native/aegis-orchestrator/SKILL.md +146 -0
- package/skills/foundation/aegis-native/aegis-quality-gates/SKILL.md +122 -0
- package/skills/foundation/aegis-native/aegis-skill-creator/SKILL.md +223 -0
- package/skills/foundation/aegis-native/aegis-skill-creator/references/hard-constraint-template.md +213 -0
- package/skills/foundation/aegis-native/aegis-skill-creator/references/skillforge-methodology.md +220 -0
- package/skills/foundation/aegis-native/dsgvo-compliance/SKILL.md +185 -0
- package/skills/foundation/aegis-native/dsgvo-compliance/references/art-13-15-templates.md +309 -0
- package/skills/foundation/aegis-native/dsgvo-compliance/references/datenpanne-runbook.md +291 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<!-- aegis-local: AEGIS-native skill, MIT-licensed; generic feature-dev workflow for AEGIS-bootstrapped repos. DB-migration -> API-route -> Service-Layer -> UI-Component -> Tests -> Optimistic-Updates with TDD-first discipline per spec hard-NICHTs. Single-file skill (no references), since the workflow generalises across stacks. -->
|
|
2
|
+
---
|
|
3
|
+
name: aegis-module-builder
|
|
4
|
+
description: Generic feature-dev workflow for AEGIS-bootstrapped repos. TDD-first pipeline - Plan / Test-red / Implement-green / Verify (gates 1-4) / Polish / Commit. Wraps DB-migrations, API-routes (secureApiRoute + Zod-strict + requireRole), service-layer, UI-components, optimistic-updates. Trigger keywords - module, feature, db-migration, api-route, refactor, neue funktion, neue api, neues modul.
|
|
5
|
+
model: sonnet
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
required_tools: "shell-ops,file-ops,task-tracking"
|
|
9
|
+
required_audit_passes: "1"
|
|
10
|
+
enforced_quality_gates: "4"
|
|
11
|
+
pre_done_audit: "true"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# aegis-module-builder — Generic Feature-Dev Workflow
|
|
15
|
+
|
|
16
|
+
The Foundation's TDD-first feature-dev skill. Wraps the canonical "DB-migration → API-route → Service-Layer → UI-Component → Tests → Optimistic-Update" pipeline with explicit Plan / Red / Green / Verify / Polish / Commit phases. Used for every non-customer-build dev task in an AEGIS-bootstrapped repo.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## HARD-CONSTRAINT — TDD-First, No Bypasses
|
|
21
|
+
|
|
22
|
+
This skill MUST follow the TDD-first discipline:
|
|
23
|
+
|
|
24
|
+
1. **Test before implementation, every time.** Phase 2 writes the failing test first. Phase 3 implements just enough code to make it green. No skipping Phase 2 "because I know what the code should look like".
|
|
25
|
+
2. **No mocks for external dependencies that will be hit in production.** If the feature uses a database, the test uses a real (test-instance) database — not a mock. If the feature calls an external API, the test uses a recorded fixture (VCR-style) — not a hand-written mock that drifts from reality.
|
|
26
|
+
3. **No `--no-verify` on commits.** Husky pre-commit runs `aegis-quality-gates --quick` (gates 1-4: build/tsc/lint/tests). Bypassing means the next commit pulls in a broken build. If a hook is firing falsely, fix the hook, don't bypass.
|
|
27
|
+
4. **No "I'll add the test later" commits.** Either the test exists and passes, or the commit doesn't happen.
|
|
28
|
+
5. **Pre-existing-tests stay green.** Running existing tests before starting + after each phase catches regressions early. If existing tests fail before any change — the workspace is broken; investigate before adding new code.
|
|
29
|
+
6. **Reference `superpowers:test-driven-development`** for the TDD-mechanics (red-green-refactor cycle, test-shape patterns, when-to-skip-test escape-hatches). This skill is the AEGIS-foundation flavor of that pattern.
|
|
30
|
+
|
|
31
|
+
If TDD-discipline can't be followed for a specific change (e.g., a one-line typo fix, a config file edit) — explicit `--no-tdd` flag with rationale documented in the commit message. Don't silent-skip.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Mission
|
|
36
|
+
|
|
37
|
+
Replace the failure-mode where "feature-dev" means "write code, hope it works, commit, see it break in CI" with a disciplined pipeline that catches regressions before commit. Be the canonical workflow for every non-customer-build dev task — DB-migration, API-route, service-extraction, UI-feature, refactor, bugfix.
|
|
38
|
+
|
|
39
|
+
**Quality bar:** every commit from this skill leaves the build green per gates 1-4 (build / tsc / lint / tests). No exceptions.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Triggers
|
|
44
|
+
|
|
45
|
+
### Slash-commands
|
|
46
|
+
|
|
47
|
+
- `/module` — start a module-build for a new feature
|
|
48
|
+
- `/feature` — alias
|
|
49
|
+
- `/refactor` — start a refactor with TDD-coverage
|
|
50
|
+
|
|
51
|
+
### Auto-trigger keywords
|
|
52
|
+
|
|
53
|
+
- module, feature, db-migration, api-route, refactor, neue funktion, neue api, neues modul, optimistic update
|
|
54
|
+
|
|
55
|
+
### Required-input
|
|
56
|
+
|
|
57
|
+
The skill needs a feature-spec. If invoked without one, ask:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
What does this feature do?
|
|
61
|
+
- User-story (1-2 sentences)
|
|
62
|
+
- Inputs (request shape, params, files)
|
|
63
|
+
- Outputs (response shape, side-effects)
|
|
64
|
+
- Acceptance-criteria (3-5 bullet points)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Don't infer from chat-context. Demand the spec.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Process
|
|
72
|
+
|
|
73
|
+
| # | Phase | Time | Output |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| 1 | Plan | ~10 min | feature-spec.md + checklist |
|
|
76
|
+
| 2 | Test (red) | ~15-30 min | failing test that asserts the feature |
|
|
77
|
+
| 3 | Implement (green) | ~30-90 min | code that makes test pass |
|
|
78
|
+
| 4 | Verify (gates 1-4) | ~5 min | all 4 gates green per `aegis-quality-gates --quick` |
|
|
79
|
+
| 5 | Polish (optimistic-updates, edge-cases) | ~15-30 min | edge-case tests + UI polish |
|
|
80
|
+
| 6 | Commit | ~5 min | atomic commit with conventional-commits message |
|
|
81
|
+
|
|
82
|
+
### Phase 1: Plan
|
|
83
|
+
|
|
84
|
+
Read the feature-spec. Decompose into testable units:
|
|
85
|
+
|
|
86
|
+
- **DB layer**: any new tables / columns / indexes? Write migration first.
|
|
87
|
+
- **API layer**: new endpoint? List inputs/outputs/auth-requirements.
|
|
88
|
+
- **Service layer**: business-logic that lives between API and DB? Extract to a pure function.
|
|
89
|
+
- **UI layer**: components that render the feature? Sketch component-tree.
|
|
90
|
+
|
|
91
|
+
Write a `<feature>-spec.md` (or update an existing planning-doc) with:
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
# Feature: <name>
|
|
95
|
+
|
|
96
|
+
## User-story
|
|
97
|
+
<1-2 sentences>
|
|
98
|
+
|
|
99
|
+
## Acceptance criteria
|
|
100
|
+
- [ ] AC1
|
|
101
|
+
- [ ] AC2
|
|
102
|
+
- [ ] AC3
|
|
103
|
+
|
|
104
|
+
## Decomposition
|
|
105
|
+
- DB: <new-table or "none">
|
|
106
|
+
- API: <route + method + auth>
|
|
107
|
+
- Service: <function-signature>
|
|
108
|
+
- UI: <component-tree>
|
|
109
|
+
|
|
110
|
+
## Test plan
|
|
111
|
+
- Unit: <list>
|
|
112
|
+
- Integration: <list>
|
|
113
|
+
- E2E: <list>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Phase 2: Test (red)
|
|
117
|
+
|
|
118
|
+
For each layer (DB / API / Service / UI), write the failing test FIRST:
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
// __tests__/<feature>/api.test.ts
|
|
122
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
123
|
+
import { POST } from '@/app/api/<endpoint>/route';
|
|
124
|
+
|
|
125
|
+
describe('POST /api/<endpoint>', () => {
|
|
126
|
+
it('returns 200 with valid input', async () => {
|
|
127
|
+
const req = new Request('http://localhost/api/<endpoint>', {
|
|
128
|
+
method: 'POST',
|
|
129
|
+
body: JSON.stringify({ /* valid input */ }),
|
|
130
|
+
});
|
|
131
|
+
const res = await POST(req);
|
|
132
|
+
expect(res.status).toBe(200);
|
|
133
|
+
const body = await res.json();
|
|
134
|
+
expect(body).toMatchObject({ /* expected shape */ });
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('returns 400 on invalid input', async () => { /* ... */ });
|
|
138
|
+
it('returns 401 when unauthenticated', async () => { /* ... */ });
|
|
139
|
+
it('returns 429 after rate-limit', async () => { /* ... */ });
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Run the test — it MUST fail (red). If it passes accidentally — the test isn't testing the right thing; rewrite it.
|
|
144
|
+
|
|
145
|
+
### Phase 3: Implement (green)
|
|
146
|
+
|
|
147
|
+
For each test, write the minimum code to make it pass:
|
|
148
|
+
|
|
149
|
+
- DB-migration: `pnpm db:migrate:create <feature>` + write the migration
|
|
150
|
+
- API-route: `app/api/<endpoint>/route.ts` with `secureApiRoute` wrapper
|
|
151
|
+
- Service-layer: pure function in `lib/services/<feature>.ts`
|
|
152
|
+
- UI-component: `components/<feature>/<Component>.tsx`
|
|
153
|
+
|
|
154
|
+
After each layer: run that layer's tests. They MUST go green. If they don't — fix the implementation, not the test (unless the test's expectation was wrong, which is rare).
|
|
155
|
+
|
|
156
|
+
### Phase 4: Verify (gates 1-4)
|
|
157
|
+
|
|
158
|
+
Run `aegis-quality-gates --quick`:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npx -y @aegis-scan/cli foundation verify --quick
|
|
162
|
+
# OR (if foundation CLI not installed yet):
|
|
163
|
+
pnpm run build && tsc --noEmit && pnpm run lint && pnpm test
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
All 4 must pass:
|
|
167
|
+
|
|
168
|
+
| Gate | Threshold |
|
|
169
|
+
|---|---|
|
|
170
|
+
| build | exit 0 |
|
|
171
|
+
| tsc | 0 errors |
|
|
172
|
+
| lint | 0 errors |
|
|
173
|
+
| tests | 100% pass (no regression in existing tests) |
|
|
174
|
+
|
|
175
|
+
If any red — fix before Phase 5. Don't proceed with red gates.
|
|
176
|
+
|
|
177
|
+
### Phase 5: Polish
|
|
178
|
+
|
|
179
|
+
Add edge-case tests + UI polish:
|
|
180
|
+
|
|
181
|
+
- **Optimistic-updates** (UI): if the feature mutates state, render the change immediately with a rollback if the API fails. Use TanStack Query / SWR mutation patterns or React useOptimistic.
|
|
182
|
+
- **Loading + error states** (UI): every async-data UI needs both states tested.
|
|
183
|
+
- **Empty-states** (UI): no data → friendly empty-state, not a blank panel.
|
|
184
|
+
- **Accessibility**: keyboard-navigation, aria-labels, focus-management.
|
|
185
|
+
- **Edge-cases** (logic): null inputs, max-length inputs, concurrent submissions.
|
|
186
|
+
|
|
187
|
+
Add tests for each polish-item. They start as red (because the polish isn't there), then green.
|
|
188
|
+
|
|
189
|
+
### Phase 6: Commit
|
|
190
|
+
|
|
191
|
+
Atomic commit per logical unit. Conventional Commits format:
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
feat(api): add /api/<endpoint> with rate-limit + Zod validation
|
|
195
|
+
|
|
196
|
+
- Migration: 0042_add_<feature>_table.sql
|
|
197
|
+
- API-route: secureApiRoute + Zod-strict
|
|
198
|
+
- Service-layer: <feature>Service.create(input)
|
|
199
|
+
- UI: <Component> with optimistic update
|
|
200
|
+
- Tests: 4 unit + 2 integration
|
|
201
|
+
|
|
202
|
+
AC1: ✓ AC2: ✓ AC3: ✓ (per spec)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
If the feature is large, split into multiple atomic commits per layer (1 for migration, 1 for API, 1 for service, 1 for UI). Each commit individually passes gates 1-4.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Verification / Success Criteria
|
|
210
|
+
|
|
211
|
+
Before declaring the module complete:
|
|
212
|
+
|
|
213
|
+
- [ ] `<feature>-spec.md` written + acceptance-criteria checked
|
|
214
|
+
- [ ] Phase 2 tests are present + were red before Phase 3
|
|
215
|
+
- [ ] Phase 3 implementation makes Phase 2 tests green
|
|
216
|
+
- [ ] Phase 4 gates 1-4 all pass via `aegis-quality-gates --quick`
|
|
217
|
+
- [ ] Phase 5 polish-items addressed (optimistic / loading / error / empty / a11y / edge)
|
|
218
|
+
- [ ] Phase 6 atomic commit(s) follow Conventional-Commits format
|
|
219
|
+
- [ ] No mocks for production-relevant deps (real DB, recorded fixtures for external APIs)
|
|
220
|
+
- [ ] Existing tests still green (no regression)
|
|
221
|
+
|
|
222
|
+
If any unmet → not done. Report the open item explicitly.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Anti-Patterns
|
|
227
|
+
|
|
228
|
+
- ❌ Skipping Phase 2 (writing implementation first) — that's not TDD; that's hope-driven-development.
|
|
229
|
+
- ❌ "I'll write the tests after, the implementation is simple enough" — every implementation is simple until the regression hits.
|
|
230
|
+
- ❌ Mocking the database in tests — drift from production behavior; use a real (test-instance) DB.
|
|
231
|
+
- ❌ Mocking external APIs with hand-written stubs — drift; use VCR-style recorded fixtures.
|
|
232
|
+
- ❌ `git commit --no-verify` to bypass husky — fix the hook, don't bypass.
|
|
233
|
+
- ❌ Committing with red gates 1-4 — every commit leaves the build green.
|
|
234
|
+
- ❌ Skipping rate-limit on a new API-route — `secureApiRoute` wrapper is mandatory.
|
|
235
|
+
- ❌ Skipping Zod-validation — every API-route validates input shape.
|
|
236
|
+
- ❌ One giant commit covering DB + API + service + UI — split into atomic commits per layer.
|
|
237
|
+
- ❌ Polish-items in Phase 5 added without tests — every polish-item gets a regression-test.
|
|
238
|
+
- ❌ Inferring `requireRole` for a new endpoint without confirming with the spec — auth is explicit, never inferred.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Extension Points
|
|
243
|
+
|
|
244
|
+
- **Different framework adapters**: Next.js (App Router) is the canonical default. Remix / SvelteKit / Astro extensions add framework-specific test-templates + route-templates. Phase 1-6 stay the same; only the file-paths + test-shapes vary per adapter.
|
|
245
|
+
- **Different DB layers**: Drizzle / Prisma / Supabase all work; the migration-step in Phase 1 + 3 reads the project's DB-layer-config and uses the right tooling.
|
|
246
|
+
- **Different test-runners**: Vitest is canonical. Jest / Bun-test / Deno-test extensions wrap their respective CLIs. The Verify-gate (Phase 4) reads the project's test-config and dispatches.
|
|
247
|
+
- **Per-project quality-gate-overrides**: a starter project might set lint-threshold to "warnings allowed". Override in `aegis.config.json` `gates.<gate>.threshold`. Don't override here.
|
|
248
|
+
- **TDD-skip escape-hatch**: for genuine 1-line fixes (typo, config), `--no-tdd` flag bypasses Phase 2 + 3 if Phase 6 commit-message documents the rationale (e.g., `chore: fix typo in /datenschutz heading [skip-tdd: 1-line text-fix]`). Use sparingly.
|
|
249
|
+
- **Multi-package monorepos**: each package gets its own pipeline. Phase 6 commits are scoped to the package via `pnpm --filter <pkg> <cmd>` or `nx affected`.
|
|
250
|
+
- **Refactor-mode**: a refactor that moves code without changing behavior runs Phase 2 first to capture current behavior in tests, then refactors with the test as a regression-guard.
|
|
251
|
+
- **Bugfix-mode**: write the failing test that reproduces the bug FIRST (Phase 2), then fix (Phase 3). The test becomes a permanent regression-test.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<!-- aegis-local: AEGIS-native skill, MIT-licensed; master-entry orchestrator that fires on every session-start, loads CLAUDE.md + AGENTS.md + latest handover + project-skill, prints tool inventory + project-state, then dispatches to the matching specialist skill (customer-build / compliance-audit / dev-feature / aegis-self-test). Pattern ported from a private reference-implementation; this is the public OSS variant. -->
|
|
2
|
+
---
|
|
3
|
+
name: aegis-orchestrator
|
|
4
|
+
description: AEGIS Master-Entry. Loads CLAUDE.md + AGENTS.md + latest handover + state.json, detects use-case (customer-build / compliance-audit / dev-feature / aegis-self-test / skill-authoring), routes to specialist skill per AGENTS.md, runs quality-gates pre-commit, writes session-end handover. Trigger keywords - start, session, bootstrap, orchestrator, phase, handover, weiter, weitermachen.
|
|
5
|
+
model: opus
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
required_tools: "shell-ops,file-ops,task-tracking"
|
|
9
|
+
required_audit_passes: "1"
|
|
10
|
+
enforced_quality_gates: "9"
|
|
11
|
+
pre_done_audit: "true"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# aegis-orchestrator — Session-Entry
|
|
15
|
+
|
|
16
|
+
Master skill for AEGIS-foundation-bootstrapped repos. Fires on every session-start (Claude Code via SessionStart-Hook in `.claude/settings.json`; Codex via the Bootstrap-section in `AGENTS.md` per the foundation spec §14.5). Ensures every new agent has full context + finds the right specialist skill before responding to the user's first request.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## HARD-CONSTRAINT — Bootstrap-Discipline
|
|
21
|
+
|
|
22
|
+
Before responding to ANY user request, this skill MUST:
|
|
23
|
+
|
|
24
|
+
1. **Read** `.claude/handover/HANDOVER-LATEST.md` (or `.codex/handover/HANDOVER-LATEST.md` — same file via symlink on `--platform=both`).
|
|
25
|
+
2. **Read** `CLAUDE.md` (project rules).
|
|
26
|
+
3. **Read** `AGENTS.md` (router + tool-mapping table — already in context if AGENTS.md was loaded).
|
|
27
|
+
4. **Read** project-skill if present: `.claude/skills/<project-slug>/SKILL.md`.
|
|
28
|
+
5. **Read** `.aegis/state.json` to pick up the use-case + last completed phase.
|
|
29
|
+
6. **Print** to the user: `Tool-inventory: [...], Skills available: [...], Project-state: phase X, Use-case: Y`.
|
|
30
|
+
7. **THEN** process the user's request — never before.
|
|
31
|
+
|
|
32
|
+
If any of (1)-(5) is missing, STOP and report the gap explicitly. Don't improvise — `aegis foundation init` should have populated them; if it hasn't, the fix is to run init, not to skip the bootstrap.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Mission
|
|
37
|
+
|
|
38
|
+
Be the universal session-opener for AEGIS-bootstrapped repositories. Eliminate the "agent starts blind, asks the user where to look" failure mode. Eliminate the "agent dispatches to a non-existent skill" failure mode. Eliminate the "agent commits without quality-gates" failure mode.
|
|
39
|
+
|
|
40
|
+
Three guarantees per session:
|
|
41
|
+
- Every agent starts with full project context (handover + CLAUDE.md + AGENTS.md + project-skill + state).
|
|
42
|
+
- Every agent dispatches to the matching specialist skill via the AGENTS.md routing-table.
|
|
43
|
+
- Every commit is preceded by `aegis-quality-gates` pre-commit verification.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Triggers
|
|
48
|
+
|
|
49
|
+
### Slash-commands
|
|
50
|
+
|
|
51
|
+
- `/start` — start of session, full bootstrap then await user-prompt
|
|
52
|
+
- `/session` — alias for /start
|
|
53
|
+
- `/bootstrap` — alias for /start
|
|
54
|
+
- `/orchestrator` — explicit invocation
|
|
55
|
+
|
|
56
|
+
### Auto-trigger keywords
|
|
57
|
+
|
|
58
|
+
Activate automatically when any of these appear in the user's first message:
|
|
59
|
+
|
|
60
|
+
- start, session, bootstrap, phase, handover, weiter, weitermachen, übergabe, recap
|
|
61
|
+
|
|
62
|
+
### Auto-trigger via SessionStart-Hook
|
|
63
|
+
|
|
64
|
+
`.claude/settings.json` configures Claude Code to invoke `aegis-orchestrator` automatically at session-start (via the harness-side hook). Codex agents read the Bootstrap-section in `AGENTS.md` and self-trigger.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Process
|
|
69
|
+
|
|
70
|
+
The skill follows a fixed bootstrap-then-dispatch sequence. No skipping.
|
|
71
|
+
|
|
72
|
+
### Phase 1: Bootstrap (mandatory, all 6 steps)
|
|
73
|
+
|
|
74
|
+
Per the HARD-CONSTRAINT block above. Stop on any missing artifact.
|
|
75
|
+
|
|
76
|
+
### Phase 2: Use-case detection
|
|
77
|
+
|
|
78
|
+
Read `.aegis/state.json` `use_case` field. If absent, infer from user's prompt keywords:
|
|
79
|
+
|
|
80
|
+
| User keywords | Use-case |
|
|
81
|
+
|---|---|
|
|
82
|
+
| build / kunde / customer / agentur / briefing / konfigurator | customer-build |
|
|
83
|
+
| audit / dsgvo / impressum / abmahnung / compliance | compliance-audit |
|
|
84
|
+
| feature / module / db / api / refactor | dev-feature |
|
|
85
|
+
| smoke / verify / self-test / aegis-test | aegis-self-test |
|
|
86
|
+
|
|
87
|
+
If no use-case can be inferred, ask the user explicitly. Don't guess silently.
|
|
88
|
+
|
|
89
|
+
### Phase 3: Specialist dispatch
|
|
90
|
+
|
|
91
|
+
Per the AGENTS.md `Use-Case Routing` table:
|
|
92
|
+
|
|
93
|
+
| Use-case | Specialist skill |
|
|
94
|
+
|---|---|
|
|
95
|
+
| customer-build | aegis-customer-build (multi-agent: Master + Research + Executor + Strategist) |
|
|
96
|
+
| compliance-audit | brutaler-anwalt (single-agent, multi-persona-internal) |
|
|
97
|
+
| dev-feature | aegis-module-builder |
|
|
98
|
+
| aegis-self-test | aegis-quality-gates → aegis-audit |
|
|
99
|
+
|
|
100
|
+
Hand off context to the specialist via inline-prompt-template (works on both Claude Code's Task tool AND Codex's spawn_agent per the foundation spec §14.3).
|
|
101
|
+
|
|
102
|
+
### Phase 4: Pre-commit gate
|
|
103
|
+
|
|
104
|
+
When the user says "commit" / "push" / "release" — orchestrator invokes `aegis-quality-gates` BEFORE the actual commit. Fails-closed: if any gate is red, commit is blocked + diagnosis printed.
|
|
105
|
+
|
|
106
|
+
### Phase 5: Session-end handover
|
|
107
|
+
|
|
108
|
+
When the user says "fertig" / "handover" / "session-ende" / "übergabe" — orchestrator invokes `aegis-handover-writer` to draft the structured handover-file + update the `HANDOVER-LATEST.md` symlink.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Verification / Success Criteria
|
|
113
|
+
|
|
114
|
+
Before declaring the orchestrator-handoff complete for a session:
|
|
115
|
+
|
|
116
|
+
- [ ] Bootstrap-checklist completed (all 6 steps, no skipping)
|
|
117
|
+
- [ ] Specialist skill identified + dispatched (or use-case ambiguity reported back to user)
|
|
118
|
+
- [ ] Quality-gates run before any commit (no `--no-verify` bypass)
|
|
119
|
+
- [ ] Session-end handover written (or explicitly deferred-to-next-session if user opts out)
|
|
120
|
+
- [ ] No specialist invoked without verifying its `metadata.required_tools` against the AGENTS.md tool-mapping table for the current harness
|
|
121
|
+
- [ ] `.aegis/state.json` updated with the new phase / last-action timestamp
|
|
122
|
+
|
|
123
|
+
If any checkbox is unmet: NOT done. Report which step is open + why + what needs to happen.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Anti-Patterns
|
|
128
|
+
|
|
129
|
+
- ❌ Skipping the bootstrap-checklist "because the user is in a hurry" — the checklist IS the foundation; skipping it breaks every downstream skill.
|
|
130
|
+
- ❌ Inventing a specialist skill that doesn't exist in `AGENTS.md` routing-table.
|
|
131
|
+
- ❌ Committing without `aegis-quality-gates` running first.
|
|
132
|
+
- ❌ Closing a session without writing a handover (next agent starts blind).
|
|
133
|
+
- ❌ Dispatching to a specialist without confirming the harness has the required tools (per AGENTS.md tool-category mapping).
|
|
134
|
+
- ❌ Improvising a use-case when the user-prompt is genuinely ambiguous — instead, ask one clear question and wait.
|
|
135
|
+
- ❌ Pretending the bootstrap files were read when they weren't (file-existence-claims that are false).
|
|
136
|
+
- ❌ Claiming `done` while the project-skill state-file shows an incomplete phase.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Extension Points
|
|
141
|
+
|
|
142
|
+
- **Add new use-cases**: extend the `Use-Case Routing` table in `AGENTS.md` plus add a new `presets/<use-case>.yaml` describing required-skills + tools + quality-gates + time-budget. Update Phase-2 keyword-inference table here accordingly.
|
|
143
|
+
- **Add new pre-commit-gates**: extend `aegis-quality-gates` SKILL.md (don't extend orchestrator). Orchestrator invokes quality-gates as a black-box.
|
|
144
|
+
- **Add new dispatch-rules**: extend Phase 3 in this skill's Process section. Each dispatch-rule maps one use-case to one specialist (or a multi-agent orchestration per spec §14.3).
|
|
145
|
+
- **Different harness support**: extend the AGENTS.md tool-category mapping to add new harness columns (e.g. Cursor, Windsurf). The orchestrator reads the mapping; no orchestrator-side change needed.
|
|
146
|
+
- **Custom SessionStart-Hook**: a project that needs additional bootstrap steps (e.g., load secrets from a vault, run a `git pull`) extends `.claude/settings.json` with a pre-orchestrator hook. Don't bake project-specific logic into this skill.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<!-- aegis-local: AEGIS-native skill, MIT-licensed; runs the canonical 9-gate quality-check sequence pre-commit and post-build, fails-closed if any gate is red, produces a JSON+markdown report. The external safety-net per spec §2 Component 5. -->
|
|
2
|
+
---
|
|
3
|
+
name: aegis-quality-gates
|
|
4
|
+
description: One-shot 9-quality-gate runner. Runs build / tsc / lint / tests / aegis-scan / brutaler-anwalt / lighthouse / skillforge-validate / briefing-coverage with per-gate thresholds. Returns exit 0 all-green or exit 1 with failing-gate list. Produces .aegis/verify-report.json + markdown summary. Trigger keywords - verify, check all gates, quality-gates, audit-gate, pre-commit-check.
|
|
5
|
+
model: sonnet
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
required_tools: "shell-ops,file-ops"
|
|
9
|
+
required_audit_passes: "1"
|
|
10
|
+
enforced_quality_gates: "9"
|
|
11
|
+
pre_done_audit: "true"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# aegis-quality-gates — 9-Gate Verifier
|
|
15
|
+
|
|
16
|
+
Single-purpose skill: run the canonical AEGIS Foundation quality-gate sequence, return pass/fail per gate, fail-closed when any gate is red. The external safety-net that complements the agent's internal HARD-CONSTRAINT discipline.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## HARD-CONSTRAINT — Fail-Closed, No Mocks
|
|
21
|
+
|
|
22
|
+
This skill is the safety-net for the entire foundation. It MUST:
|
|
23
|
+
|
|
24
|
+
1. Run real commands against the real artifact (no mocks, no skipping).
|
|
25
|
+
2. Fail-closed: if even one gate is red, return exit-non-zero — do NOT report success.
|
|
26
|
+
3. Be insurance against the failure-mode where a subagent says "it's done" while gates are silently red. The agent's self-report is not trusted; the gate-runner's exit-code is.
|
|
27
|
+
4. Emit a structured report that downstream tooling (CI, handover-writer, status-reporter) can parse — JSON at `.aegis/verify-report.json`, markdown summary printed to stdout.
|
|
28
|
+
|
|
29
|
+
If husky is bypassed via `--no-verify`: that's a violation per spec §9 hard-NICHTs. Document the override in `SECURITY-EXCEPTION.md` with rationale.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Mission
|
|
34
|
+
|
|
35
|
+
Be the single source of truth for "is this build ready to commit / push / publish". Operate as a pure function of the working tree + project preset: same inputs → same outputs, no agent-judgment-calls. Make it cheap enough to run pre-commit (every commit) AND comprehensive enough to gate post-build acceptance.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Triggers
|
|
40
|
+
|
|
41
|
+
### Slash-commands
|
|
42
|
+
|
|
43
|
+
- `/verify` — full 9-gate run
|
|
44
|
+
- `/check all gates` — alias
|
|
45
|
+
|
|
46
|
+
### Auto-trigger keywords
|
|
47
|
+
|
|
48
|
+
- verify, check all gates, quality-gates, audit-gate, pre-commit-check
|
|
49
|
+
|
|
50
|
+
### Husky pre-commit hook
|
|
51
|
+
|
|
52
|
+
`templates/customer-project/.husky/pre-commit` invokes `aegis foundation verify --quick` (gates 1-4 only — build/tsc/lint/tests). Full 9-gate run is `--final` for end-of-build. Pre-commit-quick keeps commit-loop fast.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Process
|
|
57
|
+
|
|
58
|
+
### The 9 gates (sequence + thresholds per spec §6)
|
|
59
|
+
|
|
60
|
+
| # | Gate | Command | Threshold | Mode |
|
|
61
|
+
|---|---|---|---|---|
|
|
62
|
+
| 1 | build | `npm run build` (or `pnpm run build`) | exit 0 | always |
|
|
63
|
+
| 2 | tsc | `npx tsc --noEmit` | 0 errors | always |
|
|
64
|
+
| 3 | lint | `npm run lint` (if defined) | 0 errors | always |
|
|
65
|
+
| 4 | tests | `npm test` / `pnpm vitest run` | 100% pass, no regression | always |
|
|
66
|
+
| 5 | aegis-scan | `npx -y @aegis-scan/cli scan <built-site>` | score ≥ 950, grade S/FORTRESS | --final only |
|
|
67
|
+
| 6 | brutaler-anwalt | invoke compliance/aegis-native/brutaler-anwalt skill | 0 KRITISCH, ≤ 2 HOCH | --final only |
|
|
68
|
+
| 7 | lighthouse | `npx -y @lhci/cli` | Mobile ≥ 75, Desktop ≥ 90, A11y/SEO/BP = 100 | --final only |
|
|
69
|
+
| 8 | skillforge-validate | `python3 /tmp/SkillForge/scripts/validate-skill.py <each-touched-skill>` | 16/17 or higher per touched skill | always (when skills touched) |
|
|
70
|
+
| 9 | briefing-coverage | custom check: every page in briefing.md exists in built artifact | 100% | --final + briefing present |
|
|
71
|
+
|
|
72
|
+
### Phase 1: Discover gates that apply
|
|
73
|
+
|
|
74
|
+
Read `presets/<use-case>.yaml` to determine which gates apply for this use-case + invocation-mode. customer-build uses all 9; compliance-audit uses 5+6+8 only; dev-feature uses 1-4+8.
|
|
75
|
+
|
|
76
|
+
### Phase 2: Run gates sequentially
|
|
77
|
+
|
|
78
|
+
In the order above. Capture stdout + stderr + exit-code per gate. Fail-fast if `--bail` flag set; otherwise continue and aggregate all failures into the report.
|
|
79
|
+
|
|
80
|
+
### Phase 3: Aggregate report
|
|
81
|
+
|
|
82
|
+
Write `.aegis/verify-report.json` with structured per-gate results. Print a markdown summary to stdout (one-line-per-gate with green/red marker + threshold + actual).
|
|
83
|
+
|
|
84
|
+
### Phase 4: Exit-code
|
|
85
|
+
|
|
86
|
+
Exit 0 if all applicable gates pass. Exit 1 otherwise — non-zero exit triggers husky-block on commit.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Verification / Success Criteria
|
|
91
|
+
|
|
92
|
+
This skill's own success criteria (it's a verifier-of-verifiers):
|
|
93
|
+
|
|
94
|
+
- [ ] Each of the 9 gates is implemented + integration-tested (gate fires real command, parses real output)
|
|
95
|
+
- [ ] `--quick` mode runs gates 1-4 in under 30 seconds typical (so pre-commit-loop stays usable)
|
|
96
|
+
- [ ] `--final` mode runs all 9 gates + writes `.aegis/verify-report.json` + prints markdown summary
|
|
97
|
+
- [ ] Exit-code is 0 iff every applicable gate passed (no false-positive exit 0 with red gates)
|
|
98
|
+
- [ ] Per-gate threshold is read from the active preset (`presets/<use-case>.yaml`), not hardcoded
|
|
99
|
+
- [ ] husky-template `templates/customer-project/.husky/pre-commit` invokes this skill correctly
|
|
100
|
+
- [ ] When invoked from agent-context (vs CLI): returns the same per-gate status as the CLI does
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Anti-Patterns
|
|
105
|
+
|
|
106
|
+
- ❌ Mocking gate-runs — every gate must hit the real underlying tool. No simulated outputs.
|
|
107
|
+
- ❌ Silent skipping — if a gate's underlying tool is missing (e.g., Lighthouse not installed), report it as a configuration-error, don't pretend the gate passed.
|
|
108
|
+
- ❌ Returning exit 0 while ANY gate is red — even if "the failing gate doesn't matter for this commit". Use preset to exclude gates by use-case, not by ad-hoc judgment.
|
|
109
|
+
- ❌ Allowing `--no-verify` to silently bypass — log every bypass to `SECURITY-EXCEPTION.md`, fail-closed if file is missing, alert on push.
|
|
110
|
+
- ❌ Running the full 9-gate sequence on every keystroke — pre-commit gets `--quick`, end-of-build gets `--final`.
|
|
111
|
+
- ❌ Hard-coding thresholds in the skill body — thresholds live in `presets/<use-case>.yaml` so projects with different bars (e.g., proof-of-concept vs production) can configure.
|
|
112
|
+
- ❌ Skipping the JSON report — downstream tooling depends on `.aegis/verify-report.json` being well-formed.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Extension Points
|
|
117
|
+
|
|
118
|
+
- **New gate**: add a row to the 9-gate table here + add the gate-implementation in `aegis foundation verify` CLI command code (`packages/cli/src/commands/foundation/verify.ts`). Update preset YAML schema to allow the new gate's threshold-block. Update each `presets/<use-case>.yaml` to opt-in or opt-out.
|
|
119
|
+
- **Per-project threshold-overrides**: a project's `aegis.config.json` can override the preset's threshold for one gate (e.g., a starter-template might cap aegis-scan target at 800 instead of 950). Don't override in code; override in config.
|
|
120
|
+
- **Custom gate-implementations**: for organisation-specific gates (e.g., "all images must be optimised"), add them as `presets/<use-case>.yaml` `custom_gates:` entries pointing at a node-script that returns `{name, pass, output}`. Skill calls the script as if it were a built-in gate.
|
|
121
|
+
- **Quick-vs-final composition**: extend the gate-table with a `mode` column listing `quick` / `final` / `both`. The CLI flag selects which subset runs.
|
|
122
|
+
- **Reporter formats**: report-rendering belongs in `packages/reporters` (existing). This skill emits the structured JSON; reporters render to HTML / SARIF / Markdown / etc.
|