@aegis-scan/skills 0.2.1 → 0.5.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.
Files changed (93) hide show
  1. package/ATTRIBUTION.md +171 -4
  2. package/CHANGELOG.md +112 -1
  3. package/README.md +27 -0
  4. package/dist/skills-loader.d.ts +43 -0
  5. package/dist/skills-loader.d.ts.map +1 -1
  6. package/dist/skills-loader.js +102 -0
  7. package/dist/skills-loader.js.map +1 -1
  8. package/package.json +1 -1
  9. package/skills/compliance/_INDEX.md +49 -0
  10. package/skills/compliance/aegis-native/brutaler-anwalt/CHANGELOG.md +202 -0
  11. package/skills/compliance/aegis-native/brutaler-anwalt/LICENSE +43 -0
  12. package/skills/compliance/aegis-native/brutaler-anwalt/README.md +236 -0
  13. package/skills/compliance/aegis-native/brutaler-anwalt/SKILL.md +437 -6
  14. package/skills/compliance/aegis-native/brutaler-anwalt/references/aegis-integration.md +3 -4
  15. package/skills/compliance/aegis-native/brutaler-anwalt/references/audit-patterns.md +842 -5
  16. package/skills/compliance/aegis-native/brutaler-anwalt/references/bgh-urteile.md +226 -10
  17. package/skills/compliance/aegis-native/brutaler-anwalt/references/branchenrecht.md +365 -1
  18. package/skills/compliance/aegis-native/brutaler-anwalt/references/checklisten.md +33 -0
  19. package/skills/compliance/aegis-native/brutaler-anwalt/references/dsgvo.md +26 -0
  20. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/BDSG/paragraphs.md +62 -0
  21. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/BFSG/paragraphs.md +85 -0
  22. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/BGB/paragraphs.md +112 -0
  23. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/DDG/paragraphs.md +71 -0
  24. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/DSGVO/articles.md +182 -0
  25. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/EU-Verordnungen/AI-Act-2024-1689/articles.md +108 -0
  26. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/EU-Verordnungen/DSA-2022-2065/articles.md +131 -0
  27. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/HGB-AO/paragraphs.md +61 -0
  28. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/INDEX.md +93 -0
  29. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/TDDDG/paragraphs.md +67 -0
  30. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/UWG/paragraphs.md +117 -0
  31. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/VSBG/paragraphs.md +57 -0
  32. package/skills/compliance/aegis-native/brutaler-anwalt/references/it-recht.md +22 -0
  33. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/INDEX.md +122 -0
  34. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/ai/mistral-eu.md +123 -0
  35. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/ai/openai-dpa.md +120 -0
  36. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/auth/nextauth-tom.md +120 -0
  37. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/auth/supabase-auth-tom.md +104 -0
  38. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/nextjs/proxy-csp-pattern.md +93 -0
  39. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/payment/stripe-pci-tom.md +121 -0
  40. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/tracking/plausible-pattern.md +107 -0
  41. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/AffiliateDisclaimer.tsx.example +54 -0
  42. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/COMPLIANCE-AUDIT-TRAIL-template.md +95 -0
  43. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/DSE-Section-UGC.md.example +77 -0
  44. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/DSFA-template.md +76 -0
  45. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/LostFoundReportForm-consent.tsx.example +126 -0
  46. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/README.md +33 -0
  47. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/UmamiScript.tsx.example +64 -0
  48. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/VVT-template.md +60 -0
  49. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/data-retention-cron.ts.example +52 -0
  50. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/data-retention-workflow.yml.example +47 -0
  51. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/proxy-strict-dynamic.ts.example +80 -0
  52. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/security.txt.example +26 -0
  53. package/skills/compliance/aegis-native/brutaler-anwalt/scripts/health-check.sh +120 -0
  54. package/skills/defensive/aegis-native/rls-defense/SKILL.md +110 -0
  55. package/skills/defensive/aegis-native/tenant-isolation-defense/SKILL.md +26 -0
  56. package/skills/foundation/_INDEX.md +73 -0
  57. package/skills/foundation/aegis-native/aegis-audit/SKILL.md +194 -0
  58. package/skills/foundation/aegis-native/aegis-audit/references/layer-1-headers.md +138 -0
  59. package/skills/foundation/aegis-native/aegis-audit/references/layer-2-html.md +153 -0
  60. package/skills/foundation/aegis-native/aegis-audit/references/layer-3-impressum.md +159 -0
  61. package/skills/foundation/aegis-native/aegis-audit/references/layer-4-dse.md +178 -0
  62. package/skills/foundation/aegis-native/aegis-audit/references/layer-5-cookie.md +180 -0
  63. package/skills/foundation/aegis-native/aegis-audit/references/layer-6-branche.md +204 -0
  64. package/skills/foundation/aegis-native/aegis-audit/references/layer-7-code-cross-check.md +212 -0
  65. package/skills/foundation/aegis-native/aegis-audit/references/layer-8-schadens-diagnose.md +232 -0
  66. package/skills/foundation/aegis-native/aegis-customer-build/SKILL.md +232 -0
  67. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-1-recon.md +147 -0
  68. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-2-architecture.md +164 -0
  69. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-3-component-build.md +231 -0
  70. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-4-content.md +196 -0
  71. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-5-integration.md +273 -0
  72. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-6-mid-audit.md +200 -0
  73. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-7-final-verify.md +258 -0
  74. package/skills/foundation/aegis-native/aegis-handover-writer/SKILL.md +128 -0
  75. package/skills/foundation/aegis-native/aegis-module-builder/SKILL.md +255 -0
  76. package/skills/foundation/aegis-native/aegis-orchestrator/SKILL.md +229 -0
  77. package/skills/foundation/aegis-native/aegis-quality-gates/SKILL.md +182 -0
  78. package/skills/foundation/aegis-native/aegis-skill-creator/SKILL.md +223 -0
  79. package/skills/foundation/aegis-native/aegis-skill-creator/references/hard-constraint-template.md +213 -0
  80. package/skills/foundation/aegis-native/aegis-skill-creator/references/skillforge-methodology.md +220 -0
  81. package/skills/foundation/aegis-native/dsgvo-compliance/SKILL.md +185 -0
  82. package/skills/foundation/aegis-native/dsgvo-compliance/references/art-13-15-templates.md +309 -0
  83. package/skills/foundation/aegis-native/dsgvo-compliance/references/datenpanne-runbook.md +291 -0
  84. package/skills/offensive/matty-fork/cicd-redteam/SKILL.md +531 -0
  85. package/skills/offensive/matty-fork/cloud-security/SKILL.md +106 -0
  86. package/skills/offensive/matty-fork/container-escape/SKILL.md +174 -0
  87. package/skills/offensive/matty-fork/mobile-pentester/SKILL.md +357 -0
  88. package/skills/offensive/matty-fork/subdomain-takeover/SKILL.md +154 -0
  89. package/skills/osint/elementalsouls-fork/offensive-osint/README.md +92 -0
  90. package/skills/osint/elementalsouls-fork/offensive-osint/SKILL.md +4177 -0
  91. package/skills/osint/elementalsouls-fork/osint-methodology/README.md +66 -0
  92. package/skills/osint/elementalsouls-fork/osint-methodology/SKILL.md +1695 -0
  93. package/sbom.cdx.json +0 -1
@@ -0,0 +1,255 @@
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, observable + independently verifiable)
65
+ ```
66
+
67
+ Don't infer from chat-context. Demand the spec.
68
+
69
+ ### Plans.md task discipline
70
+
71
+ Every module-build creates a row in `.aegis/Plans.md` per the format defined in `aegis-orchestrator` ("Plans.md — Live Working-Plan SSOT" section). The acceptance-criteria from the feature-spec become the AC checkboxes on the task row. As phases 2-6 run, the AC are checked off; task moves DONE only when all are checked. If a phase is blocked, the AC stays unchanged + the blocker is documented in `## Blockers`.
72
+
73
+ ---
74
+
75
+ ## Process
76
+
77
+ | # | Phase | Time | Output |
78
+ |---|---|---|---|
79
+ | 1 | Plan | ~10 min | feature-spec.md + checklist |
80
+ | 2 | Test (red) | ~15-30 min | failing test that asserts the feature |
81
+ | 3 | Implement (green) | ~30-90 min | code that makes test pass |
82
+ | 4 | Verify (gates 1-4) | ~5 min | all 4 gates green per `aegis-quality-gates --quick` |
83
+ | 5 | Polish (optimistic-updates, edge-cases) | ~15-30 min | edge-case tests + UI polish |
84
+ | 6 | Commit | ~5 min | atomic commit with conventional-commits message |
85
+
86
+ ### Phase 1: Plan
87
+
88
+ Read the feature-spec. Decompose into testable units:
89
+
90
+ - **DB layer**: any new tables / columns / indexes? Write migration first.
91
+ - **API layer**: new endpoint? List inputs/outputs/auth-requirements.
92
+ - **Service layer**: business-logic that lives between API and DB? Extract to a pure function.
93
+ - **UI layer**: components that render the feature? Sketch component-tree.
94
+
95
+ Write a `<feature>-spec.md` (or update an existing planning-doc) with:
96
+
97
+ ```markdown
98
+ # Feature: <name>
99
+
100
+ ## User-story
101
+ <1-2 sentences>
102
+
103
+ ## Acceptance criteria
104
+ - [ ] AC1
105
+ - [ ] AC2
106
+ - [ ] AC3
107
+
108
+ ## Decomposition
109
+ - DB: <new-table or "none">
110
+ - API: <route + method + auth>
111
+ - Service: <function-signature>
112
+ - UI: <component-tree>
113
+
114
+ ## Test plan
115
+ - Unit: <list>
116
+ - Integration: <list>
117
+ - E2E: <list>
118
+ ```
119
+
120
+ ### Phase 2: Test (red)
121
+
122
+ For each layer (DB / API / Service / UI), write the failing test FIRST:
123
+
124
+ ```ts
125
+ // __tests__/<feature>/api.test.ts
126
+ import { describe, it, expect, beforeEach } from 'vitest';
127
+ import { POST } from '@/app/api/<endpoint>/route';
128
+
129
+ describe('POST /api/<endpoint>', () => {
130
+ it('returns 200 with valid input', async () => {
131
+ const req = new Request('http://localhost/api/<endpoint>', {
132
+ method: 'POST',
133
+ body: JSON.stringify({ /* valid input */ }),
134
+ });
135
+ const res = await POST(req);
136
+ expect(res.status).toBe(200);
137
+ const body = await res.json();
138
+ expect(body).toMatchObject({ /* expected shape */ });
139
+ });
140
+
141
+ it('returns 400 on invalid input', async () => { /* ... */ });
142
+ it('returns 401 when unauthenticated', async () => { /* ... */ });
143
+ it('returns 429 after rate-limit', async () => { /* ... */ });
144
+ });
145
+ ```
146
+
147
+ Run the test — it MUST fail (red). If it passes accidentally — the test isn't testing the right thing; rewrite it.
148
+
149
+ ### Phase 3: Implement (green)
150
+
151
+ For each test, write the minimum code to make it pass:
152
+
153
+ - DB-migration: `pnpm db:migrate:create <feature>` + write the migration
154
+ - API-route: `app/api/<endpoint>/route.ts` with `secureApiRoute` wrapper
155
+ - Service-layer: pure function in `lib/services/<feature>.ts`
156
+ - UI-component: `components/<feature>/<Component>.tsx`
157
+
158
+ 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).
159
+
160
+ ### Phase 4: Verify (gates 1-4)
161
+
162
+ Run `aegis-quality-gates --quick`:
163
+
164
+ ```bash
165
+ npx -y @aegis-scan/cli foundation verify --quick
166
+ # OR (if foundation CLI not installed yet):
167
+ pnpm run build && tsc --noEmit && pnpm run lint && pnpm test
168
+ ```
169
+
170
+ All 4 must pass:
171
+
172
+ | Gate | Threshold |
173
+ |---|---|
174
+ | build | exit 0 |
175
+ | tsc | 0 errors |
176
+ | lint | 0 errors |
177
+ | tests | 100% pass (no regression in existing tests) |
178
+
179
+ If any red — fix before Phase 5. Don't proceed with red gates.
180
+
181
+ ### Phase 5: Polish
182
+
183
+ Add edge-case tests + UI polish:
184
+
185
+ - **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.
186
+ - **Loading + error states** (UI): every async-data UI needs both states tested.
187
+ - **Empty-states** (UI): no data → friendly empty-state, not a blank panel.
188
+ - **Accessibility**: keyboard-navigation, aria-labels, focus-management.
189
+ - **Edge-cases** (logic): null inputs, max-length inputs, concurrent submissions.
190
+
191
+ Add tests for each polish-item. They start as red (because the polish isn't there), then green.
192
+
193
+ ### Phase 6: Commit
194
+
195
+ Atomic commit per logical unit. Conventional Commits format:
196
+
197
+ ```
198
+ feat(api): add /api/<endpoint> with rate-limit + Zod validation
199
+
200
+ - Migration: 0042_add_<feature>_table.sql
201
+ - API-route: secureApiRoute + Zod-strict
202
+ - Service-layer: <feature>Service.create(input)
203
+ - UI: <Component> with optimistic update
204
+ - Tests: 4 unit + 2 integration
205
+
206
+ AC1: ✓ AC2: ✓ AC3: ✓ (per spec)
207
+ ```
208
+
209
+ 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.
210
+
211
+ ---
212
+
213
+ ## Verification / Success Criteria
214
+
215
+ Before declaring the module complete:
216
+
217
+ - [ ] `<feature>-spec.md` written + acceptance-criteria checked
218
+ - [ ] Phase 2 tests are present + were red before Phase 3
219
+ - [ ] Phase 3 implementation makes Phase 2 tests green
220
+ - [ ] Phase 4 gates 1-4 all pass via `aegis-quality-gates --quick`
221
+ - [ ] Phase 5 polish-items addressed (optimistic / loading / error / empty / a11y / edge)
222
+ - [ ] Phase 6 atomic commit(s) follow Conventional-Commits format
223
+ - [ ] No mocks for production-relevant deps (real DB, recorded fixtures for external APIs)
224
+ - [ ] Existing tests still green (no regression)
225
+
226
+ If any unmet → not done. Report the open item explicitly.
227
+
228
+ ---
229
+
230
+ ## Anti-Patterns
231
+
232
+ - ❌ Skipping Phase 2 (writing implementation first) — that's not TDD; that's hope-driven-development.
233
+ - ❌ "I'll write the tests after, the implementation is simple enough" — every implementation is simple until the regression hits.
234
+ - ❌ Mocking the database in tests — drift from production behavior; use a real (test-instance) DB.
235
+ - ❌ Mocking external APIs with hand-written stubs — drift; use VCR-style recorded fixtures.
236
+ - ❌ `git commit --no-verify` to bypass husky — fix the hook, don't bypass.
237
+ - ❌ Committing with red gates 1-4 — every commit leaves the build green.
238
+ - ❌ Skipping rate-limit on a new API-route — `secureApiRoute` wrapper is mandatory.
239
+ - ❌ Skipping Zod-validation — every API-route validates input shape.
240
+ - ❌ One giant commit covering DB + API + service + UI — split into atomic commits per layer.
241
+ - ❌ Polish-items in Phase 5 added without tests — every polish-item gets a regression-test.
242
+ - ❌ Inferring `requireRole` for a new endpoint without confirming with the spec — auth is explicit, never inferred.
243
+
244
+ ---
245
+
246
+ ## Extension Points
247
+
248
+ - **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.
249
+ - **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.
250
+ - **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.
251
+ - **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.
252
+ - **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.
253
+ - **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`.
254
+ - **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.
255
+ - **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,229 @@
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. **Read** `.aegis/Plans.md` if present — the live working-plan SSOT (see "Plans.md" section below). Skip if missing; orchestrator initializes it during Phase 3 dispatch.
30
+ 7. **Print** to the user: `Tool-inventory: [...], Skills available: [...], Project-state: phase X, Use-case: Y, Open tasks: N`.
31
+ 8. **THEN** process the user's request — never before.
32
+
33
+ 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.
34
+
35
+ ---
36
+
37
+ ## Mission
38
+
39
+ 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.
40
+
41
+ Three guarantees per session:
42
+ - Every agent starts with full project context (handover + CLAUDE.md + AGENTS.md + project-skill + state).
43
+ - Every agent dispatches to the matching specialist skill via the AGENTS.md routing-table.
44
+ - Every commit is preceded by `aegis-quality-gates` pre-commit verification.
45
+
46
+ ---
47
+
48
+ ## Triggers
49
+
50
+ ### Slash-commands
51
+
52
+ - `/start` — start of session, full bootstrap then await user-prompt
53
+ - `/session` — alias for /start
54
+ - `/bootstrap` — alias for /start
55
+ - `/orchestrator` — explicit invocation
56
+
57
+ ### Auto-trigger keywords
58
+
59
+ Activate automatically when any of these appear in the user's first message:
60
+
61
+ - start, session, bootstrap, phase, handover, weiter, weitermachen, übergabe, recap
62
+
63
+ ### Auto-trigger via SessionStart-Hook
64
+
65
+ `.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.
66
+
67
+ ---
68
+
69
+ ## Process
70
+
71
+ The skill follows a fixed bootstrap-then-dispatch sequence. No skipping.
72
+
73
+ ### Phase 1: Bootstrap (mandatory, all 6 steps)
74
+
75
+ Per the HARD-CONSTRAINT block above. Stop on any missing artifact.
76
+
77
+ ### Phase 2: Use-case detection
78
+
79
+ Read `.aegis/state.json` `use_case` field. If absent, infer from user's prompt keywords:
80
+
81
+ | User keywords | Use-case |
82
+ |---|---|
83
+ | build / kunde / customer / agentur / briefing / konfigurator | customer-build |
84
+ | audit / dsgvo / impressum / abmahnung / compliance | compliance-audit |
85
+ | feature / module / db / api / refactor | dev-feature |
86
+ | smoke / verify / self-test / aegis-test | aegis-self-test |
87
+
88
+ If no use-case can be inferred, ask the user explicitly. Don't guess silently.
89
+
90
+ ### Phase 3: Specialist dispatch
91
+
92
+ Per the AGENTS.md `Use-Case Routing` table:
93
+
94
+ | Use-case | Specialist skill |
95
+ |---|---|
96
+ | customer-build | aegis-customer-build (multi-agent: Master + Research + Executor + Strategist) |
97
+ | compliance-audit | brutaler-anwalt (single-agent, multi-persona-internal) |
98
+ | dev-feature | aegis-module-builder |
99
+ | aegis-self-test | aegis-quality-gates → aegis-audit |
100
+
101
+ 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).
102
+
103
+ ### Phase 4: Pre-commit gate
104
+
105
+ 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.
106
+
107
+ ### Phase 5: Session-end handover
108
+
109
+ 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. The handover-writer reads `.aegis/Plans.md` to summarize task-status into the handover doc.
110
+
111
+ ---
112
+
113
+ ## Plans.md — Live Working-Plan SSOT
114
+
115
+ `.aegis/Plans.md` is the single source of truth for the **current** working plan (in-flight tasks, blockers, acceptance criteria). It complements (not replaces) `state.json` (machine-readable phase-state) and handover docs (point-in-time snapshots at session boundaries).
116
+
117
+ > Concept adapted from [Chachamaru127/claude-code-harness](https://github.com/Chachamaru127/claude-code-harness) (MIT) — their `Plans.md` SSOT pattern. AEGIS adapts the idea, not the tool: no Go binary, no marketplace plugin, no `/harness-*` verb-commands. Pure markdown discipline integrated into the existing AEGIS skill cluster.
118
+
119
+ ### Lifecycle
120
+
121
+ 1. **Initialize** — orchestrator creates `.aegis/Plans.md` on first dispatch if absent. Template is the format below.
122
+ 2. **Update** — every specialist skill that performs work updates the relevant task row (status, blockers, AC checkbox progress). Module-builder, customer-build, audit, skill-creator, dsgvo-compliance all touch this file as they work.
123
+ 3. **Summarize** — handover-writer reads Plans.md at session-end and folds the open-task-list into the handover doc's `§5 Open` section.
124
+ 4. **Reset** — when a use-case completes (e.g., customer-build hits DONE-with-proof), orchestrator archives Plans.md to `.aegis/Plans-archive/<timestamp>.md` and starts a fresh one for the next use-case.
125
+
126
+ ### Format
127
+
128
+ ```markdown
129
+ # Plans.md — Working Plan
130
+
131
+ **Use-case:** customer-build (or compliance-audit / dev-feature / aegis-self-test / skill-authoring)
132
+ **Started:** 2026-04-28T14:00Z
133
+ **Last updated:** 2026-04-28T15:42Z
134
+ **Phase:** 3 of 7 (component-build)
135
+
136
+ ---
137
+
138
+ ## Tasks
139
+
140
+ ### T01 — [DONE] Briefing-validation against schema
141
+
142
+ **AC:**
143
+ - [x] Briefing parsed without errors
144
+ - [x] All required schema-fields present
145
+ - [x] Pages-list extracted with N=5 entries
146
+
147
+ **Notes:** parsed-briefing.json written to .aegis/
148
+
149
+ ### T02 — [IN PROGRESS] Component-tree binding to project library
150
+
151
+ **AC:**
152
+ - [x] Library inventory loaded
153
+ - [x] Pages 1-3 bound to library components
154
+ - [ ] Pages 4-5 bound (BLOCKER: missing testimonial-component variant)
155
+ - [ ] Component-tree exported as machine-readable JSON
156
+
157
+ **Notes:** Pages 4-5 use a variant of testimonial-card that the project library does not ship. Operator decision needed: drop the variant, request library extension, or use the closest existing variant.
158
+
159
+ ### T03 — [PENDING] Phase-6 mid-audit
160
+
161
+ **AC:**
162
+ - [ ] aegis-scan run on the in-progress build
163
+ - [ ] brutaler-anwalt HUNT on impressum + cookie + DSE
164
+ - [ ] Repair-loop ≤ 3 iterations OR document blockers
165
+
166
+ ---
167
+
168
+ ## Blockers
169
+
170
+ - B01 (T02) — Library variant missing for testimonial-card. Awaiting operator decision.
171
+ ```
172
+
173
+ ### Acceptance-Criteria template
174
+
175
+ Every task carries an explicit AC list (1-N checkboxes). The discipline:
176
+
177
+ - AC must be **observable** (passes a check, file exists, command exits 0, etc.) — not subjective ("looks good").
178
+ - AC must be **complete** — task is DONE only when all AC are checked. No "looks done at 80%".
179
+ - AC must be **independently verifiable** — another agent reading the AC list can confirm pass/fail without context from the task-author.
180
+
181
+ When task is blocked, the AC stays unchanged (don't lower the bar to fit the blocker). Document the blocker explicitly in `## Blockers` section + flag in the task row.
182
+
183
+ ### Cross-references
184
+
185
+ - `aegis-module-builder` reads Plans.md for task-AC discipline + writes back module-task progress.
186
+ - `aegis-customer-build` writes per-phase tasks into Plans.md as it executes the 7-phase pipeline.
187
+ - `aegis-audit` writes audit-finding tasks into Plans.md (1 task per layer-finding).
188
+ - `aegis-handover-writer` reads Plans.md → summarizes into handover §5 Open.
189
+ - `aegis-quality-gates` does NOT touch Plans.md — it is a stateless verifier; results go to `.aegis/verify-report.json`.
190
+
191
+ ---
192
+
193
+ ## Verification / Success Criteria
194
+
195
+ Before declaring the orchestrator-handoff complete for a session:
196
+
197
+ - [ ] Bootstrap-checklist completed (all 8 steps, no skipping)
198
+ - [ ] `.aegis/Plans.md` initialized for the current use-case (or carried-over from prior session if mid-use-case)
199
+ - [ ] Specialist skill identified + dispatched (or use-case ambiguity reported back to user)
200
+ - [ ] Quality-gates run before any commit (no `--no-verify` bypass)
201
+ - [ ] Session-end handover written (or explicitly deferred-to-next-session if user opts out)
202
+ - [ ] No specialist invoked without verifying its `metadata.required_tools` against the AGENTS.md tool-mapping table for the current harness
203
+ - [ ] `.aegis/state.json` updated with the new phase / last-action timestamp
204
+ - [ ] `.aegis/Plans.md` reflects the current task-state (closed tasks marked DONE, blockers documented)
205
+
206
+ If any checkbox is unmet: NOT done. Report which step is open + why + what needs to happen.
207
+
208
+ ---
209
+
210
+ ## Anti-Patterns
211
+
212
+ - ❌ Skipping the bootstrap-checklist "because the user is in a hurry" — the checklist IS the foundation; skipping it breaks every downstream skill.
213
+ - ❌ Inventing a specialist skill that doesn't exist in `AGENTS.md` routing-table.
214
+ - ❌ Committing without `aegis-quality-gates` running first.
215
+ - ❌ Closing a session without writing a handover (next agent starts blind).
216
+ - ❌ Dispatching to a specialist without confirming the harness has the required tools (per AGENTS.md tool-category mapping).
217
+ - ❌ Improvising a use-case when the user-prompt is genuinely ambiguous — instead, ask one clear question and wait.
218
+ - ❌ Pretending the bootstrap files were read when they weren't (file-existence-claims that are false).
219
+ - ❌ Claiming `done` while the project-skill state-file shows an incomplete phase.
220
+
221
+ ---
222
+
223
+ ## Extension Points
224
+
225
+ - **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.
226
+ - **Add new pre-commit-gates**: extend `aegis-quality-gates` SKILL.md (don't extend orchestrator). Orchestrator invokes quality-gates as a black-box.
227
+ - **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).
228
+ - **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.
229
+ - **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,182 @@
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 10-quality-gate runner. Runs build / tsc / lint / tests / aegis-scan / brutaler-anwalt / lighthouse / skillforge-validate / briefing-coverage / residue-check 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, residue-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: "10"
11
+ pre_done_audit: "true"
12
+ ---
13
+
14
+ # aegis-quality-gates — 10-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 10 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
+ | 10 | residue-check | scan for stale references (see "Residue-Check" section below) | 0 stale refs, 0 broken cross-links | --quick + --final |
72
+
73
+ ### Phase 1: Discover gates that apply
74
+
75
+ 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.
76
+
77
+ ### Phase 2: Run gates sequentially
78
+
79
+ 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.
80
+
81
+ ### Phase 3: Aggregate report
82
+
83
+ 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).
84
+
85
+ ### Phase 4: Exit-code
86
+
87
+ Exit 0 if all applicable gates pass. Exit 1 otherwise — non-zero exit triggers husky-block on commit.
88
+
89
+ ---
90
+
91
+ ## Residue-Check (Gate 10) — Stale-Reference Detection
92
+
93
+ Detects references that became stale through edits, rebases, or refactors but were not updated. The class of bug that motivated this gate: a handover-doc cited commit-SHA `c89bf3f` after a `git rebase` invalidated it, leaving an operator-procedure that pointed at a non-existent commit.
94
+
95
+ > Concept adapted from [Chachamaru127/claude-code-harness](https://github.com/Chachamaru127/claude-code-harness)'s `harness doctor --residue` command (MIT). AEGIS adapts the methodology, not the binary: pure shell + grep, integrated as gate 10 of this verifier rather than a standalone tool.
96
+
97
+ ### What counts as "residue"
98
+
99
+ | Residue class | Detection |
100
+ |---|---|
101
+ | Stale commit-SHAs in handover docs | Each 7-40 hex SHA in `*.md` is `git cat-file -e <sha>`-tested; missing → stale |
102
+ | Broken markdown cross-links to local files | Each `](./...)` or `](../...)` link is path-tested; missing target → broken |
103
+ | Orphan path references in skill bodies | Paths like `packages/skills/skills/<...>/<skill>/<...>` are existence-tested |
104
+ | Dead `<!-- aegis-local: -->` provenance refs | Header pointing at `<source>@<sha>` where `<sha>` is no longer reachable → stale fork-base |
105
+ | `_(post-X.Y.Z)_` markers past their version | Version-X.Y.Z is current → marker is stale, content should be active |
106
+ | Phantom skill names in `_INDEX.md` routing tables | Skill name in row → SKILL.md must exist at the cited path |
107
+
108
+ ### Detection commands
109
+
110
+ `aegis foundation verify --residue` (planned in Phase 3 CLI per the foundation handover §5 Pri 2) implements this gate. Until then, the methodology is documented here so any agent or operator can run it manually:
111
+
112
+ ```bash
113
+ # Stale SHA detection in handover docs
114
+ for sha in $(grep -roE '\b[0-9a-f]{7,40}\b' docs/handover seitengold-build/strategy 2>/dev/null \
115
+ | awk -F: '{print $2}' | sort -u); do
116
+ git cat-file -e "$sha" 2>/dev/null || echo "STALE-SHA: $sha"
117
+ done
118
+
119
+ # Broken markdown cross-links (relative paths)
120
+ grep -roE '\]\((\./|\.\./)[^)]+\)' packages/skills/skills/ \
121
+ | sed 's/.*\](\(.*\))/\1/' | sort -u \
122
+ | while read p; do [ -e "$p" ] || echo "BROKEN-LINK: $p"; done
123
+
124
+ # Phantom _INDEX.md skill rows
125
+ for idx in packages/skills/skills/*/_INDEX.md; do
126
+ awk -F'`' '/SKILL\.md`/ {print $4}' "$idx" \
127
+ | while read p; do [ -e "packages/skills/skills/$p" ] || echo "PHANTOM-SKILL-ROW in $idx: $p"; done
128
+ done
129
+ ```
130
+
131
+ ### Threshold
132
+
133
+ - **0 stale SHAs** in any tracked handover/state doc — strict
134
+ - **0 broken cross-links** in shipped SKILL.md or `_INDEX.md` content — strict
135
+ - **0 orphan path references** in body of any aegis-native skill — strict
136
+ - **0 phantom skill rows** in any `_INDEX.md` — strict
137
+ - **0 dead aegis-local headers** — strict
138
+
139
+ Any non-zero count fails the gate. Output written to `.aegis/verify-report.json` under `residue: { stale_shas: [...], broken_links: [...], orphan_paths: [...], phantom_rows: [...], dead_provenance: [...] }`.
140
+
141
+ ### When to run
142
+
143
+ - `--quick` mode (pre-commit): include residue-check (it's fast — pure grep + path tests, no compilation).
144
+ - `--final` mode (end-of-build, pre-publish): always include.
145
+ - `--residue` mode (operator-on-demand): runs gate 10 only, useful after a rebase or merge to verify documentation didn't fall behind.
146
+
147
+ ---
148
+
149
+ ## Verification / Success Criteria
150
+
151
+ This skill's own success criteria (it's a verifier-of-verifiers):
152
+
153
+ - [ ] Each of the 10 gates is implemented + integration-tested (gate fires real command, parses real output)
154
+ - [ ] `--quick` mode runs gates 1-4 + 10 in under 30 seconds typical (so pre-commit-loop stays usable)
155
+ - [ ] `--final` mode runs all 10 gates + writes `.aegis/verify-report.json` + prints markdown summary
156
+ - [ ] `--residue` mode runs gate 10 only (operator-on-demand post-rebase / post-merge check)
157
+ - [ ] Exit-code is 0 iff every applicable gate passed (no false-positive exit 0 with red gates)
158
+ - [ ] Per-gate threshold is read from the active preset (`presets/<use-case>.yaml`), not hardcoded
159
+ - [ ] husky-template `templates/customer-project/.husky/pre-commit` invokes this skill correctly
160
+ - [ ] When invoked from agent-context (vs CLI): returns the same per-gate status as the CLI does
161
+
162
+ ---
163
+
164
+ ## Anti-Patterns
165
+
166
+ - ❌ Mocking gate-runs — every gate must hit the real underlying tool. No simulated outputs.
167
+ - ❌ 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.
168
+ - ❌ 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.
169
+ - ❌ Allowing `--no-verify` to silently bypass — log every bypass to `SECURITY-EXCEPTION.md`, fail-closed if file is missing, alert on push.
170
+ - ❌ Running the full 10-gate sequence on every keystroke — pre-commit gets `--quick`, end-of-build gets `--final`.
171
+ - ❌ 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.
172
+ - ❌ Skipping the JSON report — downstream tooling depends on `.aegis/verify-report.json` being well-formed.
173
+
174
+ ---
175
+
176
+ ## Extension Points
177
+
178
+ - **New gate**: add a row to the 10-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.
179
+ - **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.
180
+ - **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.
181
+ - **Quick-vs-final composition**: extend the gate-table with a `mode` column listing `quick` / `final` / `both`. The CLI flag selects which subset runs.
182
+ - **Reporter formats**: report-rendering belongs in `packages/reporters` (existing). This skill emits the structured JSON; reporters render to HTML / SARIF / Markdown / etc.