@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.
Files changed (45) hide show
  1. package/ATTRIBUTION.md +60 -4
  2. package/CHANGELOG.md +78 -0
  3. package/README.md +27 -0
  4. package/dist/bin.js +1 -1
  5. package/dist/commands/list.d.ts.map +1 -1
  6. package/dist/commands/list.js +9 -2
  7. package/dist/commands/list.js.map +1 -1
  8. package/dist/skills-loader.d.ts +43 -0
  9. package/dist/skills-loader.d.ts.map +1 -1
  10. package/dist/skills-loader.js +102 -0
  11. package/dist/skills-loader.js.map +1 -1
  12. package/package.json +1 -1
  13. package/sbom.cdx.json +1 -1
  14. package/skills/compliance/_INDEX.md +49 -0
  15. package/skills/compliance/aegis-native/brutaler-anwalt/SKILL.md +100 -3
  16. package/skills/defensive/aegis-native/rls-defense/SKILL.md +25 -0
  17. package/skills/defensive/aegis-native/tenant-isolation-defense/SKILL.md +26 -0
  18. package/skills/foundation/_INDEX.md +73 -0
  19. package/skills/foundation/aegis-native/aegis-audit/SKILL.md +194 -0
  20. package/skills/foundation/aegis-native/aegis-audit/references/layer-1-headers.md +138 -0
  21. package/skills/foundation/aegis-native/aegis-audit/references/layer-2-html.md +153 -0
  22. package/skills/foundation/aegis-native/aegis-audit/references/layer-3-impressum.md +159 -0
  23. package/skills/foundation/aegis-native/aegis-audit/references/layer-4-dse.md +178 -0
  24. package/skills/foundation/aegis-native/aegis-audit/references/layer-5-cookie.md +180 -0
  25. package/skills/foundation/aegis-native/aegis-audit/references/layer-6-branche.md +204 -0
  26. package/skills/foundation/aegis-native/aegis-audit/references/layer-7-code-cross-check.md +212 -0
  27. package/skills/foundation/aegis-native/aegis-audit/references/layer-8-schadens-diagnose.md +232 -0
  28. package/skills/foundation/aegis-native/aegis-customer-build/SKILL.md +232 -0
  29. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-1-recon.md +147 -0
  30. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-2-architecture.md +164 -0
  31. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-3-component-build.md +231 -0
  32. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-4-content.md +196 -0
  33. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-5-integration.md +273 -0
  34. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-6-mid-audit.md +200 -0
  35. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-7-final-verify.md +258 -0
  36. package/skills/foundation/aegis-native/aegis-handover-writer/SKILL.md +128 -0
  37. package/skills/foundation/aegis-native/aegis-module-builder/SKILL.md +251 -0
  38. package/skills/foundation/aegis-native/aegis-orchestrator/SKILL.md +146 -0
  39. package/skills/foundation/aegis-native/aegis-quality-gates/SKILL.md +122 -0
  40. package/skills/foundation/aegis-native/aegis-skill-creator/SKILL.md +223 -0
  41. package/skills/foundation/aegis-native/aegis-skill-creator/references/hard-constraint-template.md +213 -0
  42. package/skills/foundation/aegis-native/aegis-skill-creator/references/skillforge-methodology.md +220 -0
  43. package/skills/foundation/aegis-native/dsgvo-compliance/SKILL.md +185 -0
  44. package/skills/foundation/aegis-native/dsgvo-compliance/references/art-13-15-templates.md +309 -0
  45. package/skills/foundation/aegis-native/dsgvo-compliance/references/datenpanne-runbook.md +291 -0
@@ -0,0 +1,223 @@
1
+ <!-- aegis-local: AEGIS-native skill, MIT-licensed; Meta-skill that builds new skills via SkillForge methodology + AEGIS HARD-CONSTRAINT-format. Triage (USE_EXISTING / IMPROVE / CREATE_NEW / COMPOSE) -> Scaffold via init_skill.py -> 11-Lens-Analysis -> Validate (auto-iterate to 16/17+) -> Commit. NO skill-creation without validate-pass + 3+ references + Anti-Patterns + Extension-Points sections. References to SkillForge methodology with attribution. -->
2
+ ---
3
+ name: aegis-skill-creator
4
+ description: Meta-skill that builds new skills via SkillForge methodology (tripleyak/SkillForge MIT) + AEGIS HARD-CONSTRAINT-format. Pipeline - Triage / Scaffold / 11-Lens-Iterate / Validate (16/17+) / Commit. Trigger keywords - neuer skill, skill erstellen, skill verbessern, skill audit, meta-skill, skillforge.
5
+ model: opus
6
+ license: MIT
7
+ metadata:
8
+ required_tools: "shell-ops,file-ops,task-tracking"
9
+ required_audit_passes: "2"
10
+ enforced_quality_gates: "1"
11
+ pre_done_audit: "true"
12
+ ---
13
+
14
+ # aegis-skill-creator — Meta-Skill (Skills That Build Skills)
15
+
16
+ The Foundation's meta-skill. Creates / improves / audits other skills via the SkillForge methodology (tripleyak/SkillForge, MIT) wrapped in AEGIS HARD-CONSTRAINT-format. Either produces a SKILL.md that validates 16/17+ with all required sections, or returns INCOMPLETE with the missing-checks list.
17
+
18
+ ---
19
+
20
+ ## HARD-CONSTRAINT — Reference-Loading + Validate-Gate
21
+
22
+ This skill MUST:
23
+
24
+ 1. **Load `references/skillforge-methodology.md`** before producing any skill-output. The SkillForge methodology (11-Lens-Analysis, iteration-guide, multi-lens-framework) is the canonical authoring-method.
25
+ 2. **Load `references/hard-constraint-template.md`** for the AEGIS HARD-CONSTRAINT-block structure. Every new skill carries this block.
26
+ 3. **Validate-gate is non-skippable.** Every output skill must pass `validate-skill.py` at 16/17+ before commit. Iterate up to 5 times; if not at 16/17 after 5 iterations → return INCOMPLETE with missing-check list.
27
+ 4. **Triage-first, not create-first.** Phase 1 evaluates USE_EXISTING / IMPROVE / CREATE_NEW / COMPOSE. Many "I need a new skill" requests are actually "improve this existing one"; jumping to create wastes effort.
28
+ 5. **No skill ships without:** ≥ 3 references (when complex enough to warrant), `## Anti-Patterns`, `## Extension Points`, HARD-CONSTRAINT-block in body, all-fields-populated frontmatter (model + license + metadata.required_tools + metadata.pre_done_audit).
29
+ 6. **Attribution is mandatory.** Skills derived from SkillForge methodology carry attribution-comment + reference SkillForge in `references/skillforge-methodology.md`. No silent-port.
30
+
31
+ If any of (1)-(6) cannot be satisfied → STOP, report the gap. Don't produce a partial skill.
32
+
33
+ ---
34
+
35
+ ## Mission
36
+
37
+ Eliminate the failure-mode where a coding-agent, asked to "build a skill", produces a 50-line SKILL.md that fails validate, has no references, no Anti-Patterns, and no clear extension-path. Provide an industrial-grade meta-pipeline that:
38
+
39
+ - Triages first (don't create when improve / use-existing applies)
40
+ - Uses SkillForge methodology (11 lenses)
41
+ - Wraps in AEGIS HARD-CONSTRAINT-format
42
+ - Validates auto-iteratively to 16/17+
43
+ - Returns DONE-with-validate-proof or INCOMPLETE-with-list
44
+
45
+ ---
46
+
47
+ ## Triggers
48
+
49
+ ### Slash-commands
50
+
51
+ - `/skill-creator` — create / improve / audit a skill
52
+ - `/new-skill` — alias for create
53
+ - `/skill-audit` — run audit on existing skill
54
+
55
+ ### Auto-trigger keywords
56
+
57
+ - neuer skill, skill erstellen, skill verbessern, skill audit, meta-skill, skill creator, skillforge
58
+
59
+ ### Required-input
60
+
61
+ - For CREATE: skill-name + 1-paragraph mission-statement + intended trigger-keywords + complexity-estimate (single-file vs multi-file with N references)
62
+ - For IMPROVE: existing skill-path + specific gaps to address
63
+ - For AUDIT: existing skill-path
64
+
65
+ ---
66
+
67
+ ## Process
68
+
69
+ | Phase | Time | Output |
70
+ |---|---|---|
71
+ | 1. Triage | ~5 min | decision: USE_EXISTING / IMPROVE / CREATE_NEW / COMPOSE |
72
+ | 2. Scaffold | ~5 min | folder + SKILL.md skeleton via init_skill.py-style |
73
+ | 3. Iterate (11-Lens) | ~30-60 min | full SKILL.md + references |
74
+ | 4. Validate (auto-iterate) | ~10 min | 16/17+ validation pass |
75
+ | 5. Commit | ~5 min | atomic commit + handover-update |
76
+
77
+ ### Phase 1: Triage
78
+
79
+ Evaluate the request against existing skill-pool:
80
+
81
+ ```
82
+ 1. List skills in target category (or full pool):
83
+ ls /tmp/a.e.g.i.s/packages/skills/skills/<category>/
84
+
85
+ 2. For each existing skill, read SKILL.md description:
86
+ grep "^description:" */SKILL.md
87
+
88
+ 3. Decide:
89
+ - USE_EXISTING — an existing skill already does this; route there.
90
+ - IMPROVE — an existing skill is close; extend it (new section / new reference / new triggers).
91
+ - CREATE_NEW — no existing skill covers this; new skill needed.
92
+ - COMPOSE — solve via 2+ existing skills + a coordinating wrapper.
93
+ ```
94
+
95
+ Triage decision MUST be explicit + recorded. Don't silent-create when use-existing applies.
96
+
97
+ ### Phase 2: Scaffold
98
+
99
+ For CREATE_NEW or COMPOSE:
100
+
101
+ ```bash
102
+ # Use init_skill.py (SkillForge tool) or manual scaffold
103
+ SKILL_DIR=/tmp/a.e.g.i.s/packages/skills/skills/<category>/<source>/<name>
104
+ mkdir -p "$SKILL_DIR/references"
105
+
106
+ # Write SKILL.md skeleton with:
107
+ # - Frontmatter (name, description, model, license, metadata block)
108
+ # - HARD-CONSTRAINT block placeholder
109
+ # - All required sections as headers (Mission, Triggers, Process, Verification, Anti-Patterns, Extension Points)
110
+ ```
111
+
112
+ For IMPROVE:
113
+
114
+ - Read existing SKILL.md
115
+ - Write existing-state-snapshot to `improvement-plan.md` (in skill-folder, removed before commit)
116
+ - Identify specific gaps (sections missing, references thin, frontmatter incomplete)
117
+
118
+ ### Phase 3: Iterate (11-Lens-Analysis)
119
+
120
+ Apply each lens from `references/skillforge-methodology.md`:
121
+
122
+ | Lens | Question |
123
+ |---|---|
124
+ | 1. User-Intent | What does the user actually want when they invoke this skill? |
125
+ | 2. Trigger-Keywords | What words / contexts cause this skill to fire? |
126
+ | 3. Inputs / Outputs | What does the skill take in? What does it produce? |
127
+ | 4. Process / Workflow | What's the step-by-step? |
128
+ | 5. Verification | How do you know the output is correct? |
129
+ | 6. Anti-Patterns | What goes wrong without this skill? |
130
+ | 7. Extension Points | How can future projects extend this? |
131
+ | 8. Model-Selection | Opus / Sonnet / Haiku — which fits the cognitive load? |
132
+ | 9. Tool-Categories | Which tools (shell-ops / file-ops / task-tracking / subagent-dispatch / ...) does the skill need? |
133
+ | 10. References-Set | Which external sources / patterns / templates inform this skill? |
134
+ | 11. Validate-Compliance | Will this pass `validate-skill.py` at 16/17+? |
135
+
136
+ For each lens, write a paragraph in the SKILL.md (not all in one place; lens-output maps to specific sections per `references/skillforge-methodology.md`).
137
+
138
+ ### Phase 4: Validate (auto-iterate)
139
+
140
+ ```bash
141
+ python3 /tmp/SkillForge/scripts/validate-skill.py "$SKILL_DIR"
142
+ # Note: aegis-native skills with leading <!-- aegis-local --> comment need stripping first.
143
+ # A wrapper script handles this — see CONTRIBUTING.md "Validate aegis-native skills" section.
144
+ ```
145
+
146
+ Read output. For each failing check:
147
+
148
+ - Missing section → add it
149
+ - Wrong frontmatter field → fix it
150
+ - Description too short / too long → adjust
151
+ - No tables / no examples → add them
152
+ - > 3 phases when 1-3 recommended → either consolidate or accept as advisory (per Fallstricke)
153
+
154
+ Re-run validate. Iterate up to 5 times. If still red after 5 — return INCOMPLETE with the failing-check list.
155
+
156
+ ### Phase 5: Commit
157
+
158
+ ```bash
159
+ git add "$SKILL_DIR"
160
+ git commit -m "$(cat <<EOF
161
+ feat(<category>): add <skill-name> — <one-line-purpose>
162
+
163
+ - Frontmatter with HARD-CONSTRAINT-fields (metadata.required_tools, etc.)
164
+ - Body sections per validate-skill.py contract (Mission, Triggers, Process, Verification, Anti-Patterns, Extension Points)
165
+ - N references (when multi-file)
166
+ - validate-skill.py: <N>/<M> passing
167
+
168
+ Closes <issue or skill-request reference>
169
+ EOF
170
+ )"
171
+ ```
172
+
173
+ Update aegis-native/_INDEX.md (or appropriate category-_INDEX.md) with the new skill's trigger-table row.
174
+
175
+ Update master AGENTS.md if a new use-case is introduced.
176
+
177
+ Update manifest.test EXPECTED_TOTAL + EXPECTED_NAMES_BY_CATEGORY.
178
+
179
+ ---
180
+
181
+ ## Verification / Success Criteria
182
+
183
+ Before declaring the skill-creation complete:
184
+
185
+ - [ ] Phase 1 Triage decision explicit (USE_EXISTING / IMPROVE / CREATE_NEW / COMPOSE) + recorded
186
+ - [ ] If CREATE_NEW or COMPOSE: scaffold via init_skill.py-style, all required sections present
187
+ - [ ] 11-Lens-Analysis applied (each lens-output maps to a SKILL.md section)
188
+ - [ ] `validate-skill.py` at 16/17+ (auto-iterate up to 5; if not, INCOMPLETE)
189
+ - [ ] HARD-CONSTRAINT-block in body (not just frontmatter)
190
+ - [ ] References (when multi-file): 2+ for simple, 3+ for moderate, 7+ for complex (e.g., aegis-customer-build has 7 phase-refs)
191
+ - [ ] Anti-Patterns + Extension Points sections both populated (≥ 5 items each)
192
+ - [ ] Attribution (when derived from external pattern: SkillForge / Spec-Author / etc.)
193
+ - [ ] manifest.test + attribution.test + scrub.test all green
194
+ - [ ] Atomic commit + index-updates committed together
195
+
196
+ ---
197
+
198
+ ## Anti-Patterns
199
+
200
+ - ❌ Skipping Triage Phase 1 — many "create new" requests are actually "improve existing"; triage first.
201
+ - ❌ Inventing a category for a skill that fits an existing one — use the existing category structure.
202
+ - ❌ Frontmatter-only HARD-CONSTRAINT — body needs a HARD-CONSTRAINT-section too (frontmatter signals to loader, body signals to agent).
203
+ - ❌ References that are stubs — every reference has actual content (≥ 50 lines for simple, 100+ for complex).
204
+ - ❌ No Anti-Patterns section — validate flags this; also weakens skill (no "what NOT to do" guidance).
205
+ - ❌ Validate-pass without re-checking semantics — passing 16/17 with bad content is worse than failing with good content. Read the SKILL.md after validate.
206
+ - ❌ Multi-file skill where SKILL.md exceeds 300 lines + has 0 references — split into references.
207
+ - ❌ Single-file skill with 100 lines but missing sections — add missing sections; don't claim "single-file" as excuse to skip.
208
+ - ❌ Hardcoding tool-names like "Bash" in skill body — use tool-categories ("shell-ops") per AGENTS.md tool-mapping table.
209
+ - ❌ Skipping attribution when porting from another methodology — credit + license-mention.
210
+ - ❌ Committing skill without updating manifest.test EXPECTED_TOTAL — breaks CI.
211
+
212
+ ---
213
+
214
+ ## Extension Points
215
+
216
+ - **New methodology**: SkillForge is the canonical methodology. Other methodologies (Anthropic skill-spec, custom org-spec) can be added as `references/<methodology>-methodology.md`. Phase 3 lens-table extends per methodology.
217
+ - **Auto-iteration limit**: default 5 iterations in Phase 4. Increase via `--max-iterations N` for complex new skills; decrease via `--max-iterations 2` for low-stakes auto-fixups.
218
+ - **Per-category templates**: a category (e.g., `defensive/`) might have a more specific HARD-CONSTRAINT-block-template than the generic one. Add `references/hard-constraint-template-<category>.md`.
219
+ - **Different validators**: SkillForge `validate-skill.py` is canonical. Anthropic skill-spec validator (when available) can be added as `--validator=anthropic-spec`.
220
+ - **Bulk-mode**: for migration of many existing skills to v0.3.0+ HARD-CONSTRAINT-format, add `--bulk` flag that iterates a list of skills + applies the upgrade-pattern in batch.
221
+ - **Audit-mode**: `--audit` runs validate + 11-Lens review without modifying. Returns a structured report for operator-review. Useful before bumping a skill to a new major-version.
222
+ - **Custom severity-thresholds**: a project might require 17/17 (all green, no advisory). Override via `aegis.config.json` `skill_creator.min_validate_score` (default 16).
223
+ - **Multi-skill compose-mode**: `--mode=compose` builds 2+ skills as a cluster (e.g., a domain-specific bundle with orchestrator + 3 specialist + 1 audit). Phase 4 validates each individually + the bundle's _INDEX.md.
@@ -0,0 +1,213 @@
1
+ # HARD-CONSTRAINT-Block Template
2
+
3
+ The HARD-CONSTRAINT-block is the AEGIS-native discipline-marker that turns a SKILL.md into an enforceable contract. It's parameterized per skill-type (orchestrator / builder / auditor / writer / meta).
4
+
5
+ ---
6
+
7
+ ## Why HARD-CONSTRAINT?
8
+
9
+ Without HARD-CONSTRAINT, a skill is a description. With HARD-CONSTRAINT, a skill is a precondition-checked contract:
10
+
11
+ - **Frontmatter HARD-CONSTRAINT** (under `metadata:`) — signals to the loader (`parseHardConstraintFrontmatter()`) that this skill has enforced quality-gates, a required tool-set, and a mandatory pre-done audit. The loader can refuse to dispatch the skill if the harness lacks the required tools.
12
+
13
+ - **Body HARD-CONSTRAINT-block** (after Mission) — signals to the agent that certain conditions MUST be satisfied before the skill begins work. The skill author enforces this; the agent is expected to read + obey.
14
+
15
+ Example: `aegis-customer-build` HARD-CONSTRAINT requires loading 7 phase-references + the project's component-library inventory + the configurator-briefing BEFORE Phase 1 starts. Skipping any of these guarantees a quality-regression.
16
+
17
+ ---
18
+
19
+ ## Frontmatter Template (canonical v0.3.0+)
20
+
21
+ ```yaml
22
+ ---
23
+ name: <skill-name> # kebab-case, [a-z][a-z0-9-]{2,40}
24
+ description: <one-sentence-purpose plus trigger-keywords> # 50-280 chars
25
+ model: opus | sonnet | haiku # per Lens 8
26
+ license: MIT # AEGIS-native default
27
+ metadata:
28
+ required_tools: "<csv-of-tool-categories>" # per Lens 9 + AGENTS.md tool-mapping
29
+ required_audit_passes: "<N>" # how many audit-passes the skill requires
30
+ enforced_quality_gates: "<N>" # how many of the 9 gates this skill enforces
31
+ pre_done_audit: "true" | "false" # whether this skill blocks DONE-claim until audited
32
+ ---
33
+ ```
34
+
35
+ `metadata.required_tools` examples per skill-type:
36
+
37
+ | Skill-type | required_tools |
38
+ |---|---|
39
+ | orchestrator (session-entry) | "shell-ops,file-ops,task-tracking" |
40
+ | customer-build | "shell-ops,file-ops,task-tracking,subagent-dispatch,library-engine,aegis-scan,brutaler-anwalt,lighthouse" |
41
+ | audit | "shell-ops,file-ops,curl,playwright,aegis-scan" |
42
+ | module-builder | "shell-ops,file-ops,task-tracking" |
43
+ | handover-writer | "file-ops,shell-ops" |
44
+ | quality-gates | "shell-ops,file-ops" |
45
+ | skill-creator | "shell-ops,file-ops,task-tracking" |
46
+ | compliance / dsgvo | "shell-ops,file-ops" |
47
+
48
+ ---
49
+
50
+ ## Body HARD-CONSTRAINT-Block — Per Skill-Type
51
+
52
+ The body block follows a fixed template. Header always `## HARD-CONSTRAINT — <discipline-name>`.
53
+
54
+ ### Pattern A: Orchestrator (session-entry skills)
55
+
56
+ ```markdown
57
+ ## HARD-CONSTRAINT — Bootstrap-Discipline
58
+
59
+ Before responding to ANY user request, this skill MUST:
60
+
61
+ 1. Read `<bootstrap-file-1>`.
62
+ 2. Read `<bootstrap-file-2>`.
63
+ 3. Read `<bootstrap-file-3>`.
64
+ 4. Print `Tool-inventory: [...], Skills available: [...], Project-state: ...`.
65
+ 5. THEN process the user's request.
66
+
67
+ If any of (1)-(N) is missing — STOP, report the gap. Don't improvise.
68
+ ```
69
+
70
+ Example: `aegis-orchestrator`.
71
+
72
+ ### Pattern B: Builder (customer-build / module-builder)
73
+
74
+ ```markdown
75
+ ## HARD-CONSTRAINT — Anti-Halbherzig-Discipline
76
+
77
+ Before <pipeline-start>, this skill MUST:
78
+
79
+ 1. Load all <N> phase-references in `references/`.
80
+ 2. Load <project-inventory>.
81
+ 3. Load <input-contract> (e.g., briefing, feature-spec).
82
+ 4. Validate <pages-count | feature-acceptance-criteria | etc.> commitment.
83
+ 5. <pipeline> is non-skippable.
84
+ 6. Per-phase checkpoint to `.aegis/state.json`.
85
+ 7. Final-Verify-Loop: <N> gates green OR repair-attempt OR INCOMPLETE-Status.
86
+
87
+ If any of (1)-(N) cannot be satisfied — STOP and report which precondition is missing.
88
+ ```
89
+
90
+ Example: `aegis-customer-build`.
91
+
92
+ ### Pattern C: Auditor (audit / brutaler-anwalt)
93
+
94
+ ```markdown
95
+ ## HARD-CONSTRAINT — Layer-Order, Reference-Loading, No Mocks
96
+
97
+ This skill MUST:
98
+
99
+ 1. Load all <N> layer-references BEFORE producing any finding.
100
+ 2. Execute layers in fixed order (1 → N).
101
+ 3. No mocks. Every layer hits the real target.
102
+ 4. Cross-check with <sibling-skill> at <shared-layers>.
103
+ 5. Output the canonical <N>-section format.
104
+ 6. Include <severity-classification> per layer's defined criteria.
105
+
106
+ If any layer cannot run — STOP, report which layer + why. Don't silent-skip.
107
+ ```
108
+
109
+ Example: `aegis-audit`, `brutaler-anwalt`.
110
+
111
+ ### Pattern D: Writer (handover-writer / report-writer)
112
+
113
+ ```markdown
114
+ ## HARD-CONSTRAINT — <Output>-Completeness
115
+
116
+ The <output-artifact> MUST include all <N> sections listed under `## Verification / Success Criteria`.
117
+
118
+ Skipping a section breaks <downstream-consumer>. If a section legitimately has nothing to report, write `(none this session)` rather than omitting the header.
119
+
120
+ References to <source-doc> belong in `## Recommendations` if they affect the operator's next decisions, not buried elsewhere.
121
+ ```
122
+
123
+ Example: `aegis-handover-writer`.
124
+
125
+ ### Pattern E: Verifier (quality-gates)
126
+
127
+ ```markdown
128
+ ## HARD-CONSTRAINT — Fail-Closed, No Mocks
129
+
130
+ This skill is the safety-net for <consumer>. It MUST:
131
+
132
+ 1. Run real commands against the real artifact (no mocks).
133
+ 2. Fail-closed: if even one <thing> is red, return exit-non-zero.
134
+ 3. Not be silenced via <bypass-mechanism> (`--no-verify`, etc.).
135
+ 4. Emit a structured report (JSON + markdown) downstream tooling can parse.
136
+
137
+ If <bypass> is invoked → that's a violation per spec hard-NICHTs. Document the override in <SECURITY-EXCEPTION.md>.
138
+ ```
139
+
140
+ Example: `aegis-quality-gates`.
141
+
142
+ ### Pattern F: Meta (skill-creator / framework-tooling)
143
+
144
+ ```markdown
145
+ ## HARD-CONSTRAINT — Reference-Loading + Validate-Gate
146
+
147
+ This skill MUST:
148
+
149
+ 1. Load `<methodology-reference>` before producing any output.
150
+ 2. Load `<format-template>` for the <format> structure.
151
+ 3. Validate-gate is non-skippable. Iterate up to <N> times; if not at <threshold> → INCOMPLETE.
152
+ 4. <Triage-or-similar>-first, not <action>-first.
153
+ 5. No <output> ships without: <required-fields>.
154
+ 6. Attribution is mandatory when derived from <external>.
155
+
156
+ If any of (1)-(N) cannot be satisfied → STOP, report the gap.
157
+ ```
158
+
159
+ Example: `aegis-skill-creator`.
160
+
161
+ ---
162
+
163
+ ## Block-Length Guidelines
164
+
165
+ - **Numbered list:** 4-8 items. Fewer = under-specified; more = either splitting into a sub-block or consolidating items.
166
+ - **Final escape clause:** every HARD-CONSTRAINT-block ends with "If any of (1)-(N) cannot be satisfied — STOP and report which precondition is missing. Don't improvise; the foundation depends on these guarantees." (or domain-equivalent).
167
+ - **No optional items.** If a step is "should" — move it out of HARD-CONSTRAINT. HARD-CONSTRAINT is "MUST" only.
168
+
169
+ ---
170
+
171
+ ## Cross-references to other Skills
172
+
173
+ When a HARD-CONSTRAINT requires another skill, format as:
174
+
175
+ ```
176
+ 4. Load `compliance/aegis-native/brutaler-anwalt/SKILL.md` for the spot-check passes in Phase 6 + final pass in Phase 7.
177
+ ```
178
+
179
+ The path is canonical (relative to skill-pool root) so any harness can resolve it.
180
+
181
+ ---
182
+
183
+ ## Anti-Patterns for HARD-CONSTRAINT-blocks
184
+
185
+ - ❌ Aspirational items ("ideally we should...") — HARD-CONSTRAINT is non-negotiable; aspirations belong in Mission.
186
+ - ❌ Items that aren't actually enforceable ("be thorough", "do good work") — replace with verifiable preconditions.
187
+ - ❌ More than 10 items — block becomes a wall-of-text; split into 2 sub-blocks if domain-genuinely-complex.
188
+ - ❌ Reusing the same block across all skills verbatim — each skill's preconditions are domain-specific; copy-paste-then-adapt.
189
+ - ❌ Missing the final escape-clause — without it, agents may try to silent-skip a missing precondition.
190
+ - ❌ HARD-CONSTRAINT-block before Mission — Mission first (so the reader knows context); HARD-CONSTRAINT after Mission (preconditions for the mission).
191
+ - ❌ HARD-CONSTRAINT in frontmatter only — the body block IS the discipline-marker for the agent. Both are needed.
192
+
193
+ ---
194
+
195
+ ## Migration: Adding HARD-CONSTRAINT to an Existing Skill
196
+
197
+ If upgrading a v0.2.x skill to v0.3.0+ HARD-CONSTRAINT-format:
198
+
199
+ ```
200
+ 1. Add metadata: block to frontmatter with required_tools, required_audit_passes, enforced_quality_gates, pre_done_audit.
201
+ 2. Add `## HARD-CONSTRAINT — <discipline>` section after Mission.
202
+ 3. List 4-8 numbered preconditions.
203
+ 4. End with the escape-clause.
204
+ 5. Re-run validate-skill.py.
205
+ 6. If validate score drops because of new content — review and fix.
206
+ 7. Commit with `feat(<skill-name>): HARD-CONSTRAINT-frontmatter + <N> missing sections`.
207
+ ```
208
+
209
+ Reference: brutaler-anwalt (commit `4fdd1e0`) is the canonical migration-example. 9/16 → 17/17 after migration.
210
+
211
+ ---
212
+
213
+ License: MIT. Template-content used per AEGIS-foundation public-OSS license; adapt freely for your skill-authoring.
@@ -0,0 +1,220 @@
1
+ # SkillForge Methodology Reference
2
+
3
+ **Source:** tripleyak/SkillForge — MIT-licensed. https://github.com/tripleyak/SkillForge
4
+ **Attribution:** This reference adapts SkillForge's iteration-guide + multi-lens-framework methodology for AEGIS-native skills. Original methodology by SkillForge contributors; this reference summarizes the parts directly applicable to AEGIS skill-authoring.
5
+
6
+ ---
7
+
8
+ ## What SkillForge Provides
9
+
10
+ SkillForge is a methodology + tooling for building Claude Code skills (or any AGENTS.md-aware skill-system) at industrial-grade quality.
11
+
12
+ Three principal artifacts:
13
+
14
+ - `init_skill.py` — scaffolds a skill-folder with the canonical layout
15
+ - `validate-skill.py` — validates SKILL.md against the spec (frontmatter + sections + complexity-thresholds)
16
+ - `references/multi-lens-framework.md` + `references/iteration-guide.md` — methodology
17
+
18
+ The validate-skill.py output (e.g., `16/17 passed, 1 warning`) is the canonical pass-criterion for AEGIS-native skills.
19
+
20
+ ---
21
+
22
+ ## The 11-Lens Analysis
23
+
24
+ When authoring or auditing a skill, apply each lens. Each lens-output lands in a specific SKILL.md section.
25
+
26
+ ### Lens 1: User-Intent
27
+
28
+ **Question:** What does the user *actually* want when they invoke this skill?
29
+
30
+ **Method:** Imagine the user typing `/<skill-name>` (or saying the trigger-keyword). What's the underlying need? Often the surface-request is misleading — "I need a script" might be "I need a workflow" or "I need a checklist".
31
+
32
+ **Lands in:** `## Mission` section + `description:` frontmatter.
33
+
34
+ ### Lens 2: Trigger-Keywords
35
+
36
+ **Question:** What words / contexts cause this skill to fire?
37
+
38
+ **Method:** Think of 5-10 distinct user-utterances. Distill the keywords. Verify keywords don't collide with sibling skills (e.g., two skills both triggered by "audit" would race).
39
+
40
+ **Lands in:** `## Triggers` section + `description:` keywords-list.
41
+
42
+ ### Lens 3: Inputs / Outputs
43
+
44
+ **Question:** What does the skill take in? What does it produce?
45
+
46
+ **Method:** Define the contract. Inputs = files / args / context the skill expects. Outputs = files / state / messages the skill produces. Be specific: "produces a markdown report at <path>" beats "writes some output".
47
+
48
+ **Lands in:** `## Mission` (high-level) + `## Process` (per-phase inputs/outputs).
49
+
50
+ ### Lens 4: Process / Workflow
51
+
52
+ **Question:** What's the step-by-step?
53
+
54
+ **Method:** Decompose into 3-7 phases (more = over-engineered per validator advisory). Each phase has a clear inputs → output → checkpoint pattern.
55
+
56
+ **Lands in:** `## Process` section.
57
+
58
+ ### Lens 5: Verification
59
+
60
+ **Question:** How do you know the output is correct?
61
+
62
+ **Method:** Define checkbox-list of success-criteria. Each item is independently testable.
63
+
64
+ **Lands in:** `## Verification / Success Criteria` section.
65
+
66
+ ### Lens 6: Anti-Patterns
67
+
68
+ **Question:** What goes wrong without this skill?
69
+
70
+ **Method:** Brainstorm failure-modes. The skill exists because these failure-modes are common; document them.
71
+
72
+ **Lands in:** `## Anti-Patterns` section.
73
+
74
+ ### Lens 7: Extension Points
75
+
76
+ **Question:** How can future projects extend this?
77
+
78
+ **Method:** Identify variation-axes (different stack / different industry / different threshold). Document where extensions go (which file / which config-key).
79
+
80
+ **Lands in:** `## Extension Points` section.
81
+
82
+ ### Lens 8: Model-Selection
83
+
84
+ **Question:** Opus / Sonnet / Haiku — which fits the cognitive load?
85
+
86
+ **Decision Matrix:**
87
+
88
+ | Skill type | Model |
89
+ |---|---|
90
+ | Strategic planning, multi-step orchestration, ambiguity-handling | opus |
91
+ | Routine execution with clear contract, single-flow | sonnet |
92
+ | Pattern-matching, simple lookups | haiku |
93
+
94
+ **Lands in:** `model:` frontmatter field.
95
+
96
+ ### Lens 9: Tool-Categories
97
+
98
+ **Question:** Which tools does the skill need?
99
+
100
+ **Method:** List per AGENTS.md tool-mapping table:
101
+
102
+ - shell-ops (Bash equivalent)
103
+ - file-ops (Read / Write / Edit equivalent)
104
+ - task-tracking (TodoWrite / update_plan equivalent)
105
+ - subagent-dispatch (Task / spawn_agent equivalent)
106
+ - domain-specific (aegis-scan / brutaler-anwalt / lighthouse / playwright / curl / library-engine)
107
+
108
+ **Lands in:** `metadata.required_tools` frontmatter field.
109
+
110
+ ### Lens 10: References-Set
111
+
112
+ **Question:** Which external sources / patterns / templates inform this skill?
113
+
114
+ **Method:** Identify methodologies, court-decisions, standards, prior art. Each becomes a reference under `references/`.
115
+
116
+ **Lands in:** `references/` folder + cross-mentions in body.
117
+
118
+ ### Lens 11: Validate-Compliance
119
+
120
+ **Question:** Will this pass `validate-skill.py` at 16/17+?
121
+
122
+ **Method:** Run validate. Read output. Address each failing check. Re-run.
123
+
124
+ **Lands in:** none directly — but failing this means re-iterating other lenses.
125
+
126
+ ---
127
+
128
+ ## Iteration Guide
129
+
130
+ Skills are not one-shot. Plan for ≥ 3 iterations:
131
+
132
+ ### Iteration 1: Skeleton
133
+
134
+ - Frontmatter complete (all fields populated, even with placeholder values)
135
+ - All required section-headers present (Mission / Triggers / Process / Verification / Anti-Patterns / Extension Points)
136
+ - Each section has ≥ 1 paragraph or 3 bullet-points
137
+
138
+ Validate target: 12-14/17 (most checks pass; some "thin content" warnings).
139
+
140
+ ### Iteration 2: Content-Fill
141
+
142
+ - Apply 11-Lens-Analysis to each section
143
+ - Add tables for structured information (validate likes tables)
144
+ - Add references/ folder if complexity > 200 lines (validate flags this)
145
+ - Populate Anti-Patterns + Extension Points (≥ 5 items each)
146
+
147
+ Validate target: 15-16/17.
148
+
149
+ ### Iteration 3: Polish
150
+
151
+ - Re-read SKILL.md as if you've never seen it. Does each section flow?
152
+ - Cross-check examples and code-blocks compile / make sense
153
+ - Verify trigger-keywords don't collide with other skills
154
+ - Add missing sections if validate flags any
155
+
156
+ Validate target: 16/17 (with the 1 advisory warning typically being "5+ phases — consolidate to 1-3").
157
+
158
+ ### Iteration 4-5 (if needed)
159
+
160
+ If still < 16/17:
161
+
162
+ - Re-read each failing check's exact requirement
163
+ - Read 2-3 existing 17/17 skills as canonical examples
164
+ - Apply structural fixes (sometimes adding a single ## subsection lifts 2 checks)
165
+
166
+ If after 5 iterations still < 16/17 → INCOMPLETE-Status. Don't ship sub-bar skills.
167
+
168
+ ---
169
+
170
+ ## Common Pitfalls (per Fallstricke)
171
+
172
+ 1. **Validator regex anchor** — leading `<!-- aegis-local -->` HTML comments break frontmatter detection. Strip the comment before validating (or use the wrapper script in CONTRIBUTING.md).
173
+ 2. **Frontmatter allowlist** — `validate-skill.py` rejects unknown top-level YAML fields. Custom HARD-CONSTRAINT fields nest under `metadata:`. Top-level allowed: `name`, `description`, `model`, `license`, `metadata`, `agent`, `allowed-tools`, `context`, `hooks`, `user-invocable`.
174
+ 3. **5-phase advisory** — a `## Process` section with > 3 sub-phases triggers an advisory warning ("Recommend 1-3 phases, not over-engineered"). Acceptable for genuinely-complex pipelines (customer-build has 7 phases by design); not acceptable for skills that could consolidate.
175
+ 4. **Tables warning** — "Should use tables for structured information" — triggers when complex skill has only bullets. Add 1-2 tables to lift the warning.
176
+ 5. **References warning** — "Complex skill (>200 lines) should have references/ directory" — triggers on monolithic SKILL.md. Either split into references/ or shrink SKILL.md.
177
+
178
+ ---
179
+
180
+ ## Cross-skill Authoring Pattern
181
+
182
+ When a new skill relates to existing skills:
183
+
184
+ - **Cross-mention** — body explicitly references sibling skills (e.g., aegis-audit body mentions brutaler-anwalt for cross-validation).
185
+ - **Routing-table updates** — `_INDEX.md` files in the category get the new skill's row.
186
+ - **Master AGENTS.md updates** — if a new use-case is introduced, master router gets a row.
187
+ - **manifest.test updates** — EXPECTED_TOTAL increments + EXPECTED_NAMES_BY_CATEGORY adds the new name.
188
+
189
+ These cross-skill updates land in the SAME commit as the new skill, not in a follow-up commit.
190
+
191
+ ---
192
+
193
+ ## Checklist Before Commit
194
+
195
+ - [ ] `validate-skill.py` ≥ 16/17
196
+ - [ ] 11-Lens-Analysis output mapped to sections
197
+ - [ ] HARD-CONSTRAINT-block in body (not just frontmatter)
198
+ - [ ] All required sections present + populated
199
+ - [ ] References (when multi-file) each ≥ 50 lines (simple) or 100+ lines (complex)
200
+ - [ ] Anti-Patterns + Extension Points each ≥ 5 items
201
+ - [ ] Attribution (when derived)
202
+ - [ ] _INDEX.md updated
203
+ - [ ] manifest.test EXPECTED_TOTAL incremented
204
+ - [ ] No leading `<!-- aegis-local -->` comment leaks into body (only line 1)
205
+ - [ ] Scrub-clean (no forbidden codenames)
206
+
207
+ ---
208
+
209
+ ## Reference: Original SkillForge Materials
210
+
211
+ For the original SkillForge methodology (more detail than this summary), see:
212
+
213
+ - `https://github.com/tripleyak/SkillForge/blob/main/references/multi-lens-framework.md`
214
+ - `https://github.com/tripleyak/SkillForge/blob/main/references/iteration-guide.md`
215
+ - `https://github.com/tripleyak/SkillForge/blob/main/scripts/init_skill.py`
216
+ - `https://github.com/tripleyak/SkillForge/blob/main/scripts/validate-skill.py`
217
+
218
+ This AEGIS reference adapts the relevant patterns for AEGIS-native skills with HARD-CONSTRAINT-block + foundation-quality-gates. AEGIS-specific extensions (HARD-CONSTRAINT-frontmatter under `metadata:`, the 9-gate quality-gates, the 4-section audit-output) are AEGIS-specific; SkillForge does not require them.
219
+
220
+ License: MIT. SkillForge methodology used per its MIT-license terms; this AEGIS adaptation is also MIT.