@event4u/agent-config 2.20.1 → 2.23.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 (37) hide show
  1. package/.agent-src/commands/agent-status.md +16 -0
  2. package/.agent-src/rules/caveman-speak.md +2 -0
  3. package/.agent-src/skills/adversarial-review/SKILL.md +2 -1
  4. package/.agent-src/skills/canvas-design/SKILL.md +11 -6
  5. package/.agent-src/skills/compress-memory/SKILL.md +119 -0
  6. package/.agent-src/skills/fe-design/SKILL.md +8 -0
  7. package/.agent-src/skills/prompt-optimizer/SKILL.md +29 -5
  8. package/.agent-src/skills/react-shadcn-ui/SKILL.md +9 -0
  9. package/.agent-src/skills/refine-prompt/SKILL.md +57 -0
  10. package/.agent-src/skills/tailwind-engineer/SKILL.md +14 -0
  11. package/.agent-src/templates/agents/agent-project-settings.example.yml +53 -1
  12. package/.claude-plugin/marketplace.json +2 -1
  13. package/CHANGELOG.md +101 -138
  14. package/README.md +5 -5
  15. package/docs/architecture.md +2 -2
  16. package/docs/archive/CHANGELOG-pre-2.20.0.md +159 -0
  17. package/docs/benchmarks.md +74 -0
  18. package/docs/catalog.md +5 -3
  19. package/docs/contracts/caveman-telemetry.md +83 -0
  20. package/docs/contracts/compression-default-kill-criterion.md +82 -35
  21. package/docs/contracts/cost-summary-schema.md +107 -0
  22. package/docs/contracts/file-ownership-matrix.json +48 -0
  23. package/docs/guidelines/prompt-templates.md +166 -0
  24. package/package.json +1 -1
  25. package/scripts/_lib/bench_caveman.py +273 -0
  26. package/scripts/_lib/bench_caveman_report.py +152 -0
  27. package/scripts/bench_compress_memory.py +168 -0
  28. package/scripts/bench_run.py +119 -1
  29. package/scripts/caveman_stats.py +119 -0
  30. package/scripts/check_command_count_messaging.py +2 -2
  31. package/scripts/compress_memory.py +172 -0
  32. package/scripts/cost_by_conversation.py +78 -0
  33. package/scripts/cost_summary.py +97 -0
  34. package/scripts/update_counts.py +7 -5
  35. package/scripts/validate_caveman_carveouts.py +129 -0
  36. package/scripts/validate_safe_paths.py +118 -0
  37. package/scripts/verify_roadmap_closure.py +327 -0
@@ -57,6 +57,22 @@ Extract from latest record:
57
57
  Pricing source: [`bench/pricing.yaml`](../../bench/pricing.yaml). Reader
58
58
  implementation: [`scripts/cost/track.mjs`](../../scripts/cost/track.mjs).
59
59
 
60
+ ### 3b. Read caveman delta + per-conversation cost lens
61
+
62
+ Run two read-only Python helpers (stdlib-only, no-op safe if JSONL missing):
63
+
64
+ - `python3 scripts/caveman_stats.py --format json` — per-session +
65
+ per-conversation + lifetime caveman delta. Honors suspended
66
+ multiplier (see [`docs/contracts/caveman-telemetry.md`](../docs/contracts/caveman-telemetry.md)) — delta reads `0` while suspended; display version + ACTIVE/SUSPENDED state regardless.
67
+ - `python3 scripts/cost_by_conversation.py --format json` — per-conversation
68
+ total cost + model breakdown for current conversation, sourced
69
+ from same `agents/cost-tracking/sessions.jsonl` ledger.
70
+
71
+ Surface in dashboard as one line:
72
+ `[caveman: {lifetime.delta_tokens:+,} tok lifetime · {current_conv.delta_tokens:+,} this conv · multiplier v{multiplier_version} {ACTIVE|SUSPENDED}] · [conv cost: ${current_conv.total_cost_usd:.4f}]`.
73
+
74
+ If both JSONLs missing or empty, omit line silently.
75
+
60
76
  ### 4. Calculate freshness thresholds
61
77
 
62
78
  - **Message threshold**: Next multiple of 25 ≥ current count
@@ -56,6 +56,8 @@ Post-rewrite validator runs on every reply when `speak_scope != off`:
56
56
  The rule documents the algorithm; agents apply it inline before
57
57
  sending. The mechanism is the rule, not a hidden script.
58
58
 
59
+ Optional CI-side regression lock: [`scripts/validate_caveman_carveouts.py`](../../scripts/validate_caveman_carveouts.py) takes pre/post reply pair and asserts byte-identical preservation across all seven carve-out categories — runtime mechanism stays algorithmic; script is offline check.
60
+
59
61
  ## Caveman grammar
60
62
 
61
63
  - Drop articles (`the`, `a`, `an`).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: adversarial-review
3
- description: "ONLY when user explicitly requests adversarial review, devil's advocate analysis, stress-testing a plan, or 'poke holes in this' — NOT for regular code review or design feedback."
3
+ description: "ONLY when user requests adversarial review, devil's advocate, stress-test, OR honest critique of finished work ('poke holes', 'be brutal', 'was hältst du davon') — NOT for routine code/design review."
4
4
  personas:
5
5
  - critical-challenger
6
6
  source: package
@@ -16,6 +16,7 @@ Use this skill when:
16
16
  - You've completed a plan, design, or proposed fix and are about to present it.
17
17
  - The change is non-trivial (affects multiple files, changes behavior, touches critical paths).
18
18
  - You're about to recommend an architecture or design decision.
19
+ - The user submits **finished work** (draft, post, naming decision, design proposal) and asks for an honest critical take — "what do you actually think?", "be brutal", "was hältst du wirklich davon". The flow is the same Attack-Defend-Revise loop, but on the user's artifact rather than the agent's plan.
19
20
 
20
21
  Do NOT use when:
21
22
  - The task is trivial (renaming, formatting, simple config change).
@@ -64,11 +64,12 @@ Document it in `philosophy.md` under `## Subtle reference`.
64
64
  Produce `agents/design-assets/{slug}/{slug}.{pdf|png}`:
65
65
 
66
66
  1. Pick the execution tool (Pillow, matplotlib, SVG, or framework-native)
67
- 2. Limited palette2–5 colors, intentional and cohesive
68
- 3. Geometric or organic forms per philosophy
69
- 4. Text sparse, design-forward, integrated as visual element; never overlapping, never falling off canvas
70
- 5. Marginsevery element contained, breathing room
71
- 6. Repeating patterns, layered elements, systematic markers as the philosophy permits
67
+ 2. **Font selection**pick a font that earns the philosophy. Inspect a working dir (e.g. `agents/design-assets/{slug}/fonts/` — create if missing) and place the chosen file there before render. System defaults (Arial, Helvetica, DejaVu, the matplotlib default sans) are the AI-template tell; reach for them only as deliberate fallback, never as the unexamined default
68
+ 3. Limited palette 2–5 colors, intentional and cohesive
69
+ 4. Geometric or organic forms per philosophy
70
+ 5. Textsparse, design-forward, integrated as visual element; never overlapping, never falling off canvas
71
+ 6. Margins every element contained, breathing room
72
+ 7. Repeating patterns, layered elements, systematic markers as the philosophy permits
72
73
 
73
74
  ### 5. Refinement pass
74
75
 
@@ -103,10 +104,14 @@ If the user requests a series, treat each page as a story beat — distinct but
103
104
  * **No artist mimicry** — copying a living artist's signature style is copyright risk and breaks the original-work mandate. Propose an original direction.
104
105
  * **Text discipline** — most pieces fail because text creeps in as paragraphs. Words are visual accents, not explanation.
105
106
  * **One canvas** — single page unless multi-page is explicitly requested.
106
- * **Font availability** — the environment may not ship your target font. Pick a fallback before render time, or download into the working dir first.
107
+ * **Font availability** — the environment may not ship your target font. Procedure step 4.2 governs selection; pick a fallback before render time and place the file in the working fonts dir.
107
108
  * **Output location** — always `agents/design-assets/{slug}/`. Never write binary artifacts to the repo root or to source-of-truth dirs.
108
109
  * **Refinement loop is real** — first render is the draft, not the deliverable.
109
110
 
111
+ ## Craftsmanship standard
112
+
113
+ The deliverable is judged against human-crafted work, not against AI-generated comparables. Visible deliberation, intentional asymmetry, and palette restraint are the markers; default templates, generic gradients, and centered safe layouts are the failure mode. If the artifact would pass for "auto-generated stock visual", it has not earned its place — refine until intent is legible.
114
+
110
115
  ## Frugality Standards
111
116
 
112
117
  Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md).
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: compress-memory
3
+ description: "Use when shrinking always-loaded memory files (AGENTS.md, CLAUDE.md, .cursorrules) via caveman grammar — refuses sensitive paths, round-trips via .original.md backup."
4
+ source: package
5
+ domain: process
6
+ execution:
7
+ type: assisted
8
+ handler: internal
9
+ allowed_tools: [Bash]
10
+ ---
11
+
12
+ # compress-memory
13
+
14
+ > **Experimental.** Output-side caveman dialect did not meet kill-criterion in [`bench/reports/caveman-v1.md`](../../../bench/reports/caveman-v1.md) (`vs_terse` median −9.27 %). Input-side memory compression is orthogonal use case: savings target always-loaded memory budget, not reply stream. Treat ship-criterion as **per-target measurement**, not v1 verdict.
15
+
16
+ ## When to use
17
+
18
+ Use when:
19
+
20
+ - Always-loaded memory file (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, `.windsurfrules`) close to or above host tool's char budget and maintainer wants to recover input-token headroom.
21
+ - Consumer-shipped `templates/AGENTS.md` failing `agents-md-thin-root` cap and pointer-extraction options exhausted.
22
+ - Maintainer asks to "compress this memory file" or "shrink AGENTS.md" or names input-side caveman.
23
+
24
+ ## Do NOT
25
+
26
+ - Compress reply, commit message, PR body, ticket summary, or any deliverable written *for* human reader — those are carve-outs in [`caveman-speak § Carve-outs`](../../rules/caveman-speak.md) and stay verbatim.
27
+ - Compress path matching sensitive-file denylist (`.env*`, `.netrc`, `credentials*`, `secrets*`, `id_rsa*`, `*.pem|key|p12|pfx|crt|cer|jks`, `.ssh/*`) — script refuses with `SensitivePathError` and so should you.
28
+ - Compress generated file (`.agent-src/`, `.augment/`, `.claude/`, `.cursor/`, `.clinerules/`, `.windsurfrules`) — edit source in `.agent-src.uncompressed/` and regenerate via package's sync + generate-tools scripts (`scripts/compress.sh --sync` + `scripts/compress.py --generate-tools`).
29
+ - Hand-edit compressed memory file in place — run `--decompress` first; next compress pass refuses on body-hash drift (`CompressionRefused`).
30
+ - Commit compressed file without committing matching `.original.md` backup — round-trip breaks otherwise.
31
+
32
+ ## Procedure
33
+
34
+ 1. **Analyse target first.** Before any write, **inspect** target with `view` or `wc -l` to confirm it is always-loaded memory file (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, `GEMINI.md`, `.windsurfrules`), not generated, and has prose paragraphs to compress (pointer-only Thin-Root file may net near-zero). Skip rest of procedure if any check fails.
35
+ 2. **Check denylist gate.** Run `python3 scripts/compress_memory.py <path> --check` — exit 0 = safe; exit 2 = denylist hit, stop and surface refusal.
36
+ 3. **Record baseline.** `wc -c <path>` — capture pre-compression char count for commit message.
37
+ 4. **Compress.** `python3 scripts/compress_memory.py <path>`. Script writes `<path>.original.md` (verbatim backup) and rewrites `<path>` with `original_sha256:` + `compressed_at:` frontmatter.
38
+ 5. **Inspect diff.** Eyeball every Iron-Law fence, numbered-options block, code fence, backtick span, `❌`/`⚠️`/`✅` line, and frontmatter pair — all must be byte-identical. Body prose may have lost articles (`the`/`a`/`an`) and auxiliaries (`is`/`are`/`was`/`be`/`that`/`which`).
39
+ 6. **Validate idempotency.** Re-run `python3 scripts/compress_memory.py <path>` — clean re-run is no-op (body hash matches). Non-zero exit = stop, escalate.
40
+ 7. **Commit both files together.** `<path>` and `<path>.original.md` ship as pair. Backup is rollback path; never commit one without other.
41
+ 8. **Rollback path.** If readability fails review at step 5: `python3 scripts/compress_memory.py <path> --decompress` restores backup and deletes `.original.md`.
42
+
43
+ ## Output format
44
+
45
+ Maintainer-facing report after invoking script MUST contain, in this order:
46
+
47
+ 1. **Diff line** — pre/post `wc -c` as single line (`AGENTS.md: 2,891 → 2,453 chars (−15.1 %)`).
48
+ 2. **Backup path** — full path of `.original.md` backup so maintainer can verify it landed on disk.
49
+ 3. **Carve-out check** — one line confirming seven carve-out classes round-tripped (`carve-outs: 7 classes preserved · idempotent re-run: clean`).
50
+ 4. **Exit-code surface** — on failure, surface verbatim exit code and exception name (`SensitivePathError → exit 2`, `CompressionRefused → exit 3`, `FileNotFoundError → exit 4`); do not paraphrase.
51
+
52
+ Do **not** narrate algorithm, grammar rules, or carve-out theory — rule and this skill document contract; output reports result.
53
+
54
+ ## Carve-outs — byte-for-byte preserved
55
+
56
+ Mirrors seven carve-out classes in [`caveman-speak`](../../rules/caveman-speak.md). Compression engine in [`scripts/compress_memory.py`](../../../scripts/compress_memory.py) preserves:
57
+
58
+ 1. **Triple-backtick fences** — any language, any depth.
59
+ 2. **Numbered-options lines** — `^>?\s*\d+\.\s` plus `**Recommendation:**` / `**Empfehlung:**` label.
60
+ 3. **Backtick spans** — file paths, command names, identifiers inside body prose.
61
+ 4. **Status / error markers** — lines starting with `❌`, `⚠️`, `✅`.
62
+ 5. **Iron-Law ALL-CAPS lines** — `^[A-Z][A-Z0-9 ,.\-_/']{3,}$`.
63
+ 6. **Frontmatter blocks** — `---` fence pairs at head of file.
64
+ 7. **Mode markers** per [`role-mode-adherence`](../../rules/role-mode-adherence.md).
65
+
66
+ Mangling any of these breaks Iron-Law surface host tool reads. Unit tests in `tests/test_compress_memory.py` lock each carve-out class as regression case.
67
+
68
+ ## Idempotency contract — Step 9 guard
69
+
70
+ Script is **idempotent on clean re-runs**: running it twice on same target is no-op because body hash matches recompressed hash. Script **refuses** on **body drift**:
71
+
72
+ | State | Outcome |
73
+ |---|---|
74
+ | No frontmatter SHA marker | Compress + write backup + inject SHA. |
75
+ | SHA marker present, body re-compresses to same hash | No-op (return target unchanged). |
76
+ | SHA marker present, body hash diverged | **Refuse** with `CompressionRefused` exit 3. |
77
+
78
+ If you need to edit compressed memory file, run `--decompress` first, edit restored `.original.md` content, then re-run compressor. Never hand-edit compressed body — next CI run will either silently corrupt your edit (if it happens to re-compress to same shape) or hard-fail next compress pass.
79
+
80
+ ## Sensitive-path gate
81
+
82
+ Every read path passes through [`scripts/validate_safe_paths.py`](../../../scripts/validate_safe_paths.py) `assert_safe()` before bytes leave disk. Gate is security floor for Phase 2 (input-side compression) per `step-16-caveman-substance.md` Phase 0; rollback of gate is rollback of this skill.
83
+
84
+ CLI exit codes:
85
+
86
+ - `0` — compress / decompress / check succeeded.
87
+ - `2` — `SensitivePathError` (path matched denylist).
88
+ - `3` — `CompressionRefused` (body hash diverged from frontmatter SHA).
89
+ - `4` — `FileNotFoundError` (no `.original.md` backup to restore).
90
+
91
+ ## Gotchas
92
+
93
+ - **Body-hash drift after manual edit** — hand-editing compressed body breaks `original_sha256:` invariant. Next compress pass refuses with `CompressionRefused` (exit 3). Recovery: `--decompress`, edit restored body, re-compress.
94
+ - **`.original.md` backup missing on `--decompress`** — exit 4 (`FileNotFoundError`). Either someone deleted backup or `--decompress` already ran. Restore from git history; never regenerate backup by hand (regenerated content would not be byte-identical).
95
+ - **Denylist false positive** — sensitive-looking filename outside denylist surface (project-specific naming) will still pass `assert_safe()`. Denylist necessary but not sufficient; maintainer responsible for never feeding secrets to compressor.
96
+ - **Frontmatter ordering with existing keys** — if target already has frontmatter, compressor preserves existing keys, drops any prior `original_sha256:` / `compressed_at:` entries, and appends new pair. Other agents reading file should treat SHA + timestamp pair as canonical compression marker, not file size.
97
+ - **Negative savings on pointer-heavy files** — `templates/AGENTS.md` already following Thin-Root (≥ 40 % pointers, ≥ 60-char *why*-clauses) has little prose left to drop; compression may net near-zero or even add bytes via frontmatter. Run [`agents-md-thin-root`](../agents-md-thin-root/SKILL.md) first to maximise pointer share, then measure whether this skill still pays.
98
+ - **Generated-tree drift** — compressing `.agent-src.uncompressed/templates/AGENTS.md` does NOT propagate to `.augment/`, `.claude/`, etc. until package's sync + generate-tools scripts run (`scripts/compress.sh --sync` + `scripts/compress.py --generate-tools`). Always regenerate after compressing templated file.
99
+
100
+ ## Measurement — when to compress
101
+
102
+ No published `caveman-v2` baseline for input-side savings yet (Step 11 of `step-16-caveman-substance.md` ships that). Until then, maintainer judges per-target whether compression pays its readability cost. Suggested workflow:
103
+
104
+ 1. `wc -c <path>` before — record baseline char count.
105
+ 2. `python3 scripts/compress_memory.py <path>` — compress + back up.
106
+ 3. `wc -c <path>` after — record post-compression char count.
107
+ 4. Eyeball diff: does prose stay legible? Are all Iron-Law fences intact?
108
+ 5. If yes → commit both `<path>` and `<path>.original.md`. If no → `--decompress`.
109
+
110
+ Future `caveman-v2.md` will tabulate realised input-token saving against `agents-md-thin-root` 40 % pointer-ratio constraint so maintainer has numerical floor.
111
+
112
+ ## Cross-references
113
+
114
+ - [`caveman-speak`](../../rules/caveman-speak.md) — runtime rule script mirrors for input-side targets; `caveman.speak_scope` does **not** gate this script (input-side runs regardless).
115
+ - [`scripts/validate_safe_paths.py`](../../../scripts/validate_safe_paths.py) — Phase 0 gate; ported from upstream Caveman `63a91ec`.
116
+ - [`scripts/compress_memory.py`](../../../scripts/compress_memory.py) — implementation.
117
+ - [`tests/test_compress_memory.py`](../../../tests/test_compress_memory.py) — regression locks for each carve-out + idempotency + denylist.
118
+ - [`docs/contracts/compression-default-kill-criterion.md`](../../../docs/contracts/compression-default-kill-criterion.md) — v1 verdict (output-side; informs but does not gate this skill).
119
+ - [`agents-md-thin-root`](../agents-md-thin-root/SKILL.md) — caps consumer-shipped `templates/AGENTS.md`; this skill is one tool to land under cap.
@@ -199,6 +199,14 @@ Step indicator (1 — 2 — 3)
199
199
  5. **Loading states** — Skeleton screens or spinners, never blank screens
200
200
  6. **Error recovery** — Clear error messages with suggested actions
201
201
 
202
+ ## Aesthetic direction
203
+
204
+ Audit-pinned tokens and components always take precedence (see `existing-ui-audit`). When the audit pins an aesthetic, honor it without deviation. When the audit shows **no pinned aesthetic** — greenfield surface, marketing landing page, brand-new feature without design-system precedent — the design brief is allowed (and expected) to commit to a deliberate direction instead of defaulting to safe centered hero + 3-column features + CTA.
205
+
206
+ Pick one direction up front and let composition, typography, and color follow from it. Avoid the "neutral AI default": uniform grid, system fonts as the visible body face, purple-to-blue gradients on white, predictable spacing. A direction that fits the brand intent (editorial / brutalist / refined / playful / retro / maximal / minimal / etc.) and is consistent across the page beats hedging.
207
+
208
+ Surface the chosen direction in the design brief as a one-line statement (e.g. `aesthetic: editorial-magazine — asymmetric grid, serif display + sans body, generous gutters`). The apply step (`react-shadcn-ui` / `blade-ui` / `livewire` / `flux`) reads this line and matches typography, spacing, and motion to it; if no line is present, the apply step uses project defaults.
209
+
202
210
  ## Procedure
203
211
 
204
212
  When `directives/ui/design.py` (or any caller) cites this skill:
@@ -29,14 +29,30 @@ domain: product
29
29
 
30
30
  1. **Deconstruct** — extract core intent, key entities, output shape, constraints; map what's provided vs missing.
31
31
  2. **Diagnose** — audit clarity gaps, ambiguity, missing specificity, missing structure; flag unstated assumptions.
32
- 3. **Develop** — pick techniques by request type:
33
- - *Creative* → multi-perspective + tone anchoring
34
- - *Technical* → constraint-based + precision focus
35
- - *Educational* → few-shot examples + clear structure
36
- - *Complex* → chain-of-thought + systematic framing
32
+ 3. **Develop** — pick technique + template by request type:
33
+ - *Creative* → multi-perspective + tone anchoring (template: **CO-STAR** or **CRISPE**)
34
+ - *Technical* → constraint-based + precision focus (template: **RTF** or **File-Scope**)
35
+ - *Educational* → few-shot examples + clear structure (template: **Few-Shot** or **RISEN**)
36
+ - *Complex / multi-step* → chain-of-thought + systematic framing (template: **CoT** or **ReAct**)
37
+ - *Image AI (Midjourney / SD / DALL·E)* → **Visual Descriptor** or **Reference-Image-Edit**
37
38
  - Assign an AI role/expertise; layer context; add logical structure.
39
+ - Full template catalogue + when-to-pick rubric: [`docs/guidelines/prompt-templates.md`](../../../docs/guidelines/prompt-templates.md).
38
40
  4. **Deliver** — output the optimized prompt + a short "what changed" + (DETAIL only) techniques applied + one pro-tip.
39
41
 
42
+ ## Setting awareness
43
+
44
+ The skill reads `prompt_optimization.outbound` (or `.default` when no
45
+ outbound override is set) from `.agent-project-settings.yml`:
46
+
47
+ | Mode | Behaviour |
48
+ |---|---|
49
+ | `off` | The skill refuses; the dispatcher echoes the user's prompt verbatim with a one-line note. |
50
+ | `mini` | BASIC path only — safe defaults, no clarifying questions, no template selection (use the user's structure as-is). Hard cap: 1 turn. |
51
+ | `max` *(default)* | Full 4-D + template selection. DETAIL mode auto-detects per the table below. |
52
+
53
+ Any prompt starting with the configured `prompt_optimization.bypass_prefix`
54
+ (default `/raw`) is echoed verbatim, no shaping, no template.
55
+
40
56
  ## Modes — BASIC vs DETAIL
41
57
 
42
58
  **Auto-detect on first turn:**
@@ -100,6 +116,7 @@ Format per § Output format. Do **not** execute the optimized prompt yourself un
100
116
  - The model tends to over-engineer BASIC mode — for a one-line ask, the optimized prompt should still be short. No 800-word system prompts for "help with my resume".
101
117
  - Don't drift into German welcome text. The optimized prompt mirrors the user's source-language preference; the skill's own scaffolding stays English (per `language-and-tone` for `.md`).
102
118
  - The model tends to **mix languages** in the optimized prompt when the user wrote in German but named an English-speaking target audience — pick one language for the whole optimized prompt body (default: source-language of the rough prompt unless the user explicitly named the target audience's language).
119
+ - The model tends to inherit upstream dogma that "only 5 techniques are safe" (few-shot, role, structured-output, constraint-based, chain-of-thought). That claim travels with `nidhinjs/prompt-master` and is **rejected here** — CO-STAR, RISEN, CRISPE, ReAct, and the image-AI templates land in [`docs/guidelines/prompt-templates.md`](../../../docs/guidelines/prompt-templates.md) and are first-class. Pick by request type, not by upstream whitelist.
103
120
 
104
121
  ## Do NOT
105
122
 
@@ -107,3 +124,10 @@ Format per § Output format. Do **not** execute the optimized prompt yourself un
107
124
  - Do NOT ask more than one clarifying question per turn (`ask-when-uncertain` Iron Law).
108
125
  - Do NOT add an "I'm Lyra" preamble on every turn — the welcome belongs to the command entry point, not every reply.
109
126
  - Do NOT modify project files — this skill is conversational, no file writes, no commits.
127
+ - Do NOT restructure a prompt that starts with the configured `bypass_prefix` (default `/raw`). Echo it verbatim with a one-line note.
128
+
129
+ ## See also
130
+
131
+ - [`refine-prompt`](../refine-prompt/SKILL.md) — engine-inbound sibling; same `prompt_optimization` setting controls its mode
132
+ - [`docs/guidelines/prompt-templates.md`](../../../docs/guidelines/prompt-templates.md) — 12-template catalogue cited from Develop step
133
+ - AI Council session: `agents/council-responses/prompt-master-mini.json` (2026-05-17) — analysis behind template adoption and the 5-safe-dogma rejection <!-- council-ref-allowed: ADR decision trace -->
@@ -49,6 +49,15 @@ Do NOT use when:
49
49
  - Every interactive primitive must declare a focus-visible state via
50
50
  `focus-visible:ring-2 focus-visible:ring-ring`; that comes for free with
51
51
  the generated primitives but is easy to remove during a refactor.
52
+ - **Anti-AI-slop: shadcn-default look.** The out-of-the-box shadcn
53
+ theme + `Inter`-as-system-fallback + neutral grays reads as
54
+ template across projects. Unless `state.ui_audit.design_tokens`
55
+ pins the neutral palette as the project's identity, the polish
56
+ step should match typography and color tokens to the design
57
+ brief's `aesthetic:` line (from `fe-design` aesthetic-direction).
58
+ Theme/font drift within a single audited project breaks
59
+ consistency — variation lives between projects, not between
60
+ components in the same surface.
52
61
 
53
62
  ## Covered primitives
54
63
 
@@ -54,6 +54,50 @@ calling command (`/work`) owns prompt capture; this skill only refines.
54
54
  If `raw` is missing, empty, or whitespace-only the resolver already
55
55
  raised `PromptResolverError`. The skill never receives that input.
56
56
 
57
+ ## Modes and bypass
58
+
59
+ The skill honours `prompt_optimization.inbound` (or
60
+ `prompt_optimization.default` when no inbound override is set) from
61
+ `.agent-project-settings.yml` / `.agent-settings.yml`. Three modes:
62
+
63
+ | Mode | Behaviour |
64
+ |---|---|
65
+ | `off` | The skill is a no-op. The dispatcher writes `confidence={"band":"high","score":1.0}` directly and the engine proceeds with the literal prompt. No assumption inference, no clarifying questions. |
66
+ | `mini` | Stack-aware light shaping. Steps 1-2 run; step 3 only emits `assumes:` lines for *implicit stack constraints* (framework, package manager) detected from config files. Steps 4-5 produce 3 AC bullets max. Low-band halts ask at most one question; medium-band halts are auto-confirmed silently. |
67
+ | `max` *(default)* | Full procedure — every step 1–6 runs. Medium-band halts surface the assumption list verbatim; low-band halts ask one clarifying question. This is the existing behaviour. |
68
+
69
+ **Bypass prefix.** If the raw prompt starts with the configured
70
+ `prompt_optimization.bypass_prefix` (default `/raw`), the skill
71
+ becomes a no-op regardless of mode. The dispatcher strips the
72
+ prefix, passes the remainder through verbatim, and records
73
+ `bypass:true` in the envelope so downstream surfaces (delivery
74
+ report, `--no-prose-synthesis`) can attribute the skip.
75
+
76
+ ```
77
+ /raw migrate auth.service.ts to use jose, keep the API shape
78
+ ```
79
+
80
+ `/raw` is reserved at the prompt boundary only — it has no meaning
81
+ mid-prompt and is not stripped when it appears inside the body.
82
+
83
+ ### Stack-config read (mini / max only)
84
+
85
+ When the mode is `mini` or `max`, step 3 may read these config files
86
+ (read-only, scope-locked) to enrich the `assumes:` block:
87
+
88
+ - `package.json` — JS / TS framework detection (Next.js App vs Pages,
89
+ Remix, SvelteKit, Astro, Expo, …)
90
+ - `composer.json` — PHP framework detection (Laravel, Symfony,
91
+ framework-less)
92
+ - `pyproject.toml` / `requirements.txt` — Python framework detection
93
+ - `CLAUDE.md` / `AGENTS.md` — project-declared stack hints
94
+ - `.cursorrules` — project-declared stack hints
95
+ - `tsconfig.json` — TS path-alias / module-resolution hints
96
+
97
+ The skill MUST NOT read source files, `.env*`, secrets, or user
98
+ data. Detection lands as a single `assumes: stack=<framework>@<version>`
99
+ line; the medium-band halt is the user's chance to flip it.
100
+
57
101
  ## Procedure
58
102
 
59
103
  ### 1. Read and analyze the prompt
@@ -220,11 +264,24 @@ For `low`, the question replaces the AC list:
220
264
  `data.reconstructed_ac` and `data.assumptions`.
221
265
  - Do NOT re-derive band thresholds in prose. They live in
222
266
  `confidence.py` and only there.
267
+ - Do NOT read source files, `.env*`, secrets, or arbitrary user
268
+ files when stack-detecting in mini / max mode. The allowlist
269
+ above (`package.json`, `composer.json`, `pyproject.toml`,
270
+ `requirements.txt`, `CLAUDE.md`, `AGENTS.md`, `.cursorrules`,
271
+ `tsconfig.json`) is exhaustive.
272
+ - Do NOT strip the `bypass_prefix` mid-prompt. The prefix is only
273
+ recognised at the prompt boundary; matches inside the body stay
274
+ literal.
275
+ - Do NOT silently rewrite the prompt in `max` mode without
276
+ surfacing the assumption list on a medium-band halt. The diff
277
+ is the contract.
223
278
 
224
279
  ## See also
225
280
 
226
281
  - [`refine-ticket`](../refine-ticket/SKILL.md) — sibling for ticket-shaped input
282
+ - [`prompt-optimizer`](../prompt-optimizer/SKILL.md) — engine-outbound sibling; same `prompt_optimization` setting controls its mode
227
283
  - [`work_engine.resolvers.prompt`](../../templates/scripts/work_engine/resolvers/prompt.py) — envelope builder
228
284
  - [`work_engine.scoring.confidence`](../../templates/scripts/work_engine/scoring/confidence.py) — rubric + band thresholds
229
285
  - [`ask-when-uncertain`](../../rules/ask-when-uncertain.md) — one-question-per-turn Iron Law
230
286
  - [`artifact-drafting-protocol`](../../rules/artifact-drafting-protocol.md) — this skill was drafted under it
287
+ - AI Council session: `agents/council-responses/prompt-master-mini.json` (2026-05-17) — analysis behind the mini/max split and `/raw` bypass <!-- council-ref-allowed: ADR decision trace -->
@@ -117,6 +117,20 @@ Risks: <arbitrary values, !important, dark-mode gaps>
117
117
  break the design system; they accumulate silently.
118
118
  - `@apply` inside component CSS interacts with PurgeCSS — keep it
119
119
  in files Tailwind scans, not in vendor CSS.
120
+ - **Anti-AI-slop: gradients.** Unless audit-pinned or brief-explicit,
121
+ avoid the default purple-to-blue / cyan-to-pink gradients on white —
122
+ they read as auto-generated. Reach for a single accent from the
123
+ token map, or a duotone built from configured tokens.
124
+ - **Anti-AI-slop: typography.** Unless audit-pinned, avoid surfacing
125
+ the system stack (`font-sans` fallback to Arial / Helvetica / Inter
126
+ via system defaults) as the *visible* body face. If `tailwind.config`
127
+ pins a font family, use it; if not, treat the missing token as a
128
+ gap to flag, not a license to ship the OS default.
129
+ - **Anti-AI-slop: layout.** Unless audit-pinned, the centered hero +
130
+ 3-column features + CTA stack is the AI-template tell. Break the
131
+ grid intentionally (asymmetric column split, overlap, diagonal
132
+ flow) when the brief allows; cite the design brief's `aesthetic:`
133
+ line if `fe-design`'s aesthetic-direction section produced one.
120
134
 
121
135
  ## Do NOT
122
136
 
@@ -39,7 +39,7 @@ schema_version: 1
39
39
  # CI guard: a release bump of `package.json` must update this value
40
40
  # in lockstep — see scripts/check_template_pin_drift.py (road-to-
41
41
  # portable-runtime-and-update-check P3.3).
42
- agent_config_version: "2.20.0"
42
+ agent_config_version: "2.21.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project:
@@ -152,6 +152,58 @@ quality:
152
152
  # Known: eslint, prettier, tsc, biome.
153
153
  tools: [eslint, prettier, tsc]
154
154
 
155
+ # --- Prompt optimization (engine-inbound + engine-outbound) ---
156
+ #
157
+ # Controls how aggressively the agent reshapes a free-form prompt
158
+ # *before* the engine plans (`/work "<prompt>"`) and how the
159
+ # outbound `/optimize-prompt` skill polishes a copy-and-paste
160
+ # prompt for an external AI.
161
+ #
162
+ # Single-knob model — `default:` applies to both inbound and
163
+ # outbound surfaces unless an override key is set:
164
+ #
165
+ # off — engine runs the user's literal prompt. No reconstruction,
166
+ # no AC inference, no template selection. Closest to "raw"
167
+ # behaviour; useful for power users who already write
168
+ # structured prompts.
169
+ # mini — light shaping. Inbound: `refine-prompt` runs in
170
+ # stack-aware mode (reads `package.json` / `CLAUDE.md` /
171
+ # `.cursorrules` only to infer the framework), asks at
172
+ # most 5 targeted clarifying questions, emits a structured
173
+ # 6-block prompt. Outbound: BASIC mode of `prompt-optimizer`
174
+ # (4-D pass with safe defaults, no clarifying questions).
175
+ # max — full restructure. Inbound: `refine-prompt` runs the
176
+ # 5-dimension confidence rubric + assumption inference;
177
+ # medium-band halts surface the assumption list, low-band
178
+ # asks one clarifying question. Outbound: DETAIL mode of
179
+ # `prompt-optimizer` with template selection (RTF, CO-STAR,
180
+ # RISEN, CRISPE, …) per `docs/guidelines/prompt-templates.md`.
181
+ #
182
+ # Default `max` reshapes every prompt before the engine plans —
183
+ # the AI Council (anthropic/openai, 2026-05-17) warned this risks
184
+ # latency, token cost, and loss of author intent on the inbound
185
+ # side. If that bites you, uncomment `inbound: mini` below. The
186
+ # outbound side (explicit `/optimize-prompt`) is opt-in and stays
187
+ # at `max` regardless.
188
+ #
189
+ # Bypass: any prompt starting with `bypass_prefix` skips both
190
+ # inbound and outbound shaping verbatim. `/`-prefixed slash
191
+ # commands (`/work`, `/commit`, …) and `#`-prefixed memory entries
192
+ # auto-bypass.
193
+ prompt_optimization:
194
+ default: max
195
+
196
+ # Optional per-surface overrides. Leave commented to inherit
197
+ # `default:`. Council-recommended split is `inbound: mini,
198
+ # outbound: max` — uncomment if you want fewer interceptions
199
+ # on `/work` but full polish on `/optimize-prompt`.
200
+ # inbound: mini
201
+ # outbound: max
202
+
203
+ # Prefix that skips all shaping. Must start with `/` to align
204
+ # with this project's slash-command convention. Default `/raw`.
205
+ bypass_prefix: "/raw"
206
+
155
207
  # --- Locked keys (override this file only; never locks .agent-settings.yml) ---
156
208
  #
157
209
  # List keys from this file whose values cannot be overridden by a
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Shared agent configuration \u2014 skills for AI coding tools (Claude Code, Augment, Cursor, Cline, Windsurf, Gemini CLI).",
9
- "version": "2.20.1",
9
+ "version": "2.23.0",
10
10
  "keywords": [
11
11
  "agent-config",
12
12
  "skills",
@@ -99,6 +99,7 @@
99
99
  "./.claude/skills/competitive-positioning",
100
100
  "./.claude/skills/composer-packages",
101
101
  "./.claude/skills/compress",
102
+ "./.claude/skills/compress-memory",
102
103
  "./.claude/skills/content-funnel-design",
103
104
  "./.claude/skills/context",
104
105
  "./.claude/skills/context-authoring",