@event4u/agent-config 2.15.0 → 2.17.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 (106) hide show
  1. package/.agent-src/commands/ghostwriter/delete.md +118 -0
  2. package/.agent-src/commands/ghostwriter/fetch.md +185 -0
  3. package/.agent-src/commands/ghostwriter/list.md +102 -0
  4. package/.agent-src/commands/ghostwriter/show.md +113 -0
  5. package/.agent-src/commands/ghostwriter/write.md +160 -0
  6. package/.agent-src/commands/ghostwriter.md +96 -0
  7. package/.agent-src/commands/post-as/ghostwriter.md +66 -0
  8. package/.agent-src/commands/post-as/me.md +124 -0
  9. package/.agent-src/commands/post-as.md +58 -0
  10. package/.agent-src/ghostwriter/README.md +61 -0
  11. package/.agent-src/ghostwriter/fictional-fixture-v1.md +94 -0
  12. package/.agent-src/personas/README.md +8 -0
  13. package/.agent-src/rules/domain-safety-disclaimer-consulting.md +52 -0
  14. package/.agent-src/rules/domain-safety-disclaimer-financial.md +54 -0
  15. package/.agent-src/rules/domain-safety-disclaimer-legal.md +49 -0
  16. package/.agent-src/rules/domain-safety-disclaimer-medical.md +56 -0
  17. package/.agent-src/rules/domain-safety-export-redact.md +65 -0
  18. package/.agent-src/rules/domain-safety-logging-pii-floor.md +55 -0
  19. package/.agent-src/rules/domain-safety-pii-finance.md +57 -0
  20. package/.agent-src/rules/domain-safety-pii-marketing.md +60 -0
  21. package/.agent-src/rules/domain-safety-pii-recruiting.md +56 -0
  22. package/.agent-src/rules/domain-safety-pii-support.md +57 -0
  23. package/.agent-src/rules/domain-safety-retention-finance.md +48 -0
  24. package/.agent-src/rules/domain-safety-retention-support.md +55 -0
  25. package/.agent-src/skills/api-design/SKILL.md +3 -0
  26. package/.agent-src/skills/authz-review/SKILL.md +3 -0
  27. package/.agent-src/skills/competitive-moat-analysis/SKILL.md +3 -0
  28. package/.agent-src/skills/competitive-positioning/SKILL.md +3 -0
  29. package/.agent-src/skills/content-funnel-design/SKILL.md +3 -0
  30. package/.agent-src/skills/contracts-cognition/SKILL.md +3 -0
  31. package/.agent-src/skills/dashboard-design/SKILL.md +3 -0
  32. package/.agent-src/skills/data-handling-judgment/SKILL.md +3 -0
  33. package/.agent-src/skills/dcf-modeling/SKILL.md +3 -0
  34. package/.agent-src/skills/deal-qualification-meddic/SKILL.md +3 -0
  35. package/.agent-src/skills/discovery-interview/SKILL.md +3 -0
  36. package/.agent-src/skills/editorial-calendar/SKILL.md +3 -0
  37. package/.agent-src/skills/forecast-accuracy/SKILL.md +3 -0
  38. package/.agent-src/skills/forecasting/SKILL.md +3 -0
  39. package/.agent-src/skills/fundraising-narrative/SKILL.md +3 -0
  40. package/.agent-src/skills/gtm-launch/SKILL.md +3 -0
  41. package/.agent-src/skills/incident-commander/SKILL.md +3 -0
  42. package/.agent-src/skills/launch-readiness/SKILL.md +3 -0
  43. package/.agent-src/skills/messaging-architecture/SKILL.md +3 -0
  44. package/.agent-src/skills/okr-tree-modeling/SKILL.md +3 -0
  45. package/.agent-src/skills/pipeline-strategy/SKILL.md +3 -0
  46. package/.agent-src/skills/playwright-architect/SKILL.md +3 -0
  47. package/.agent-src/skills/privacy-review/SKILL.md +4 -1
  48. package/.agent-src/skills/quality-tools/SKILL.md +3 -0
  49. package/.agent-src/skills/release-comms/SKILL.md +3 -0
  50. package/.agent-src/skills/runway-cognition/SKILL.md +3 -0
  51. package/.agent-src/skills/scenario-modeling/SKILL.md +3 -0
  52. package/.agent-src/skills/secrets-management/SKILL.md +3 -0
  53. package/.agent-src/skills/tech-debt-tracker/SKILL.md +3 -0
  54. package/.agent-src/skills/unit-economics-modeling/SKILL.md +3 -0
  55. package/.agent-src/skills/voc-extract/SKILL.md +3 -0
  56. package/.agent-src/skills/voice-and-tone-design/SKILL.md +3 -0
  57. package/.agent-src/templates/agents/agent-project-settings.example.yml +16 -1
  58. package/.agent-src/templates/scripts/work_engine/_lib/agent_settings.py +299 -20
  59. package/.claude-plugin/marketplace.json +10 -1
  60. package/CHANGELOG.md +200 -211
  61. package/README.md +55 -23
  62. package/config/gitignore-block.txt +8 -0
  63. package/docs/announcements/2026-05-non-dev-launch.md +79 -0
  64. package/docs/architecture.md +2 -2
  65. package/docs/archive/CHANGELOG-pre-2.15.0.md +244 -0
  66. package/docs/case-studies/_template.md +60 -0
  67. package/docs/catalog.md +24 -3
  68. package/docs/contracts/agent-user-schema.md +1 -0
  69. package/docs/contracts/command-clusters.md +2 -0
  70. package/docs/contracts/file-ownership-matrix.json +490 -0
  71. package/docs/contracts/ghostwriter-schema.md +337 -0
  72. package/docs/contracts/init-telemetry.md +133 -0
  73. package/docs/contracts/router-blending.md +71 -0
  74. package/docs/contracts/universal-skills.md +92 -0
  75. package/docs/contracts/write-engine.md +142 -0
  76. package/docs/getting-started-by-role.md +89 -0
  77. package/docs/getting-started-laravel.md +72 -0
  78. package/docs/getting-started.md +2 -2
  79. package/docs/installation.md +221 -2
  80. package/docs/safety.md +30 -0
  81. package/package.json +1 -1
  82. package/scripts/_cli/cmd_doctor.py +238 -8
  83. package/scripts/_cli/cmd_migrate.py +6 -1
  84. package/scripts/_cli/cmd_prune.py +8 -3
  85. package/scripts/_cli/cmd_sync.py +7 -3
  86. package/scripts/_cli/cmd_uninstall.py +4 -3
  87. package/scripts/_cli/cmd_update.py +5 -1
  88. package/scripts/_cli/cmd_validate.py +6 -3
  89. package/scripts/_cli/cmd_versions.py +15 -2
  90. package/scripts/_lib/agent_settings.py +299 -20
  91. package/scripts/agent-config +64 -0
  92. package/scripts/bench_runner.py +158 -0
  93. package/scripts/check_role_doc_links.py +110 -0
  94. package/scripts/compress.py +11 -0
  95. package/scripts/ghostwriter_fixture_allowlist.txt +16 -0
  96. package/scripts/install +39 -2
  97. package/scripts/install.py +304 -1
  98. package/scripts/install.sh +20 -0
  99. package/scripts/lint_ghostwriter_source.py +240 -0
  100. package/scripts/measure_skill_reduction.py +102 -0
  101. package/scripts/schemas/rule.schema.json +5 -0
  102. package/scripts/schemas/skill.schema.json +6 -0
  103. package/scripts/update-github-metadata.sh +84 -0
  104. package/templates/agent-config-wrapper.sh +7 -0
  105. package/templates/minimal/.agent-settings.yml +23 -0
  106. package/templates/minimal/agents-gitkeep +2 -0
@@ -0,0 +1,142 @@
1
+ ---
2
+ stability: beta
3
+ keep-beta-until: 2026-08-13
4
+ ---
5
+
6
+ # Write-engine contract (v1)
7
+
8
+ > **Status:** beta — shared procedural contract consumed by
9
+ > `/ghostwriter:write`, `/post-as:ghostwriter` (alias), and
10
+ > `/post-as:me`. Locked alongside the ghostwriter cluster roadmap.
11
+
12
+ The **write engine** is the deterministic procedure that produces a
13
+ copyable markdown draft in a captured voice. It deliberately has no
14
+ implementation file — the engine is a sequence of steps the host
15
+ agent follows verbatim. The same steps are referenced by every
16
+ consumer command; the **only** axis of variation is:
17
+
18
+ 1. **Style source** — which file the engine reads to load the voice.
19
+ 2. **Disclosure footer** — appended when the style source is *external*
20
+ (a ghostwriter profile), omitted when the style source is *self*
21
+ (`.agent-user.md`).
22
+
23
+ ## Style sources
24
+
25
+ | Consumer command | Style source | Footer |
26
+ |---|---|---|
27
+ | `/ghostwriter:write` | `agents/ghostwriter/<slug>.md` (selected) | **Mandatory** |
28
+ | `/post-as:ghostwriter` | Same as above (thin alias) | **Mandatory** |
29
+ | `/post-as:me` | `.agent-user.md` (project root) | **Omitted** — user is the author |
30
+
31
+ No other style source is permitted in v1. Consuming `personas/*.md`
32
+ voices is explicitly out of scope — personas are review lenses, not
33
+ author voices.
34
+
35
+ ## Procedure (followed verbatim by every consumer)
36
+
37
+ ### 1. Resolve the style source
38
+
39
+ Each consumer command resolves a single style source before invoking
40
+ the engine. The engine receives a fully populated style object with:
41
+
42
+ - `identity.name` (for the footer when applicable)
43
+ - `style.fingerprint.*` (sentence length, register, opener / closer
44
+ patterns, hashtag / emoji rules, paragraph cadence)
45
+ - `style.free_form_notes` (or `voice_sample` for `/post-as:me`)
46
+ - `taboos` (ghostwriter only — empty list for `/post-as:me`)
47
+
48
+ Missing style source → consumer command aborts with a pointer at the
49
+ appropriate setup command (`/ghostwriter:fetch` or `/agents user init`).
50
+
51
+ ### 2. Collect the topic + modifiers
52
+
53
+ One question per turn, in this order:
54
+
55
+ 1. **Topic** — required. Plain prose, no quoting.
56
+ 2. **Tone** — optional. Enum: `formal | casual | neutral`. Default
57
+ inherits `style.fingerprint.vocab_register` mapped per the table
58
+ below.
59
+ 3. **Length** — optional. Integer word count. Default: see the
60
+ per-channel defaults table.
61
+ 4. **Channel** — optional. Enum: `linkedin-post | tweet | blog | freeform`.
62
+ Default: `freeform`.
63
+ 5. **Audience** — optional. Free-form one-line descriptor.
64
+
65
+ Modifiers may be supplied via flags (`--tone=casual --length=200
66
+ --channel=linkedin-post --audience="early-stage founders"`) to skip
67
+ the interactive interview. `--as=<slug>` selects the ghostwriter
68
+ non-interactively for `/ghostwriter:write` and the alias.
69
+
70
+ #### Per-channel defaults
71
+
72
+ | Channel | Length default | Cadence guidance |
73
+ |---|---|---|
74
+ | `tweet` | 50 words | One paragraph, no lists. |
75
+ | `linkedin-post` | 180 words | 2–4 short paragraphs. Hashtags only if `style.fingerprint.hashtag_rules` allows. |
76
+ | `blog` | 600 words | Inherits `style.fingerprint.paragraph_cadence`. |
77
+ | `freeform` | 250 words | Inherits `style.fingerprint.paragraph_cadence`. |
78
+
79
+ #### Vocab-register → tone mapping (default inheritance)
80
+
81
+ | `vocab_register` | Default `tone` |
82
+ |---|---|
83
+ | `casual` / `conversational` | `casual` |
84
+ | `professional` / `literary` | `neutral` |
85
+ | `academic` | `formal` |
86
+
87
+ ### 3. Apply negative-constraint pass (ghostwriter only)
88
+
89
+ Before drafting, the engine surfaces the loaded `taboos` list and
90
+ explicitly excludes those moves from the draft (no political
91
+ endorsements, no profanity, no hashtag-driven posts, etc.). For
92
+ `/post-as:me`, the negative-constraint pass is skipped (the user does
93
+ not pre-declare taboos in v1).
94
+
95
+ ### 4. Draft
96
+
97
+ Emit the body as a single fenced markdown block. The body MUST:
98
+
99
+ - Match `style.fingerprint.sentence_length_avg` within ±25%.
100
+ - Honour `style.fingerprint.opener_patterns` for the first sentence.
101
+ - Honour `style.fingerprint.closer_patterns` for the last sentence.
102
+ - Respect `style.fingerprint.hashtag_rules` and `emoji_rules`.
103
+ - Stay within ±15% of the requested length.
104
+
105
+ ### 5. Append the disclosure footer (ghostwriter only)
106
+
107
+ For ghostwriter consumers, append on its own line, separated by a
108
+ blank line:
109
+
110
+ ```
111
+ Written in the style of <identity.name>, not by them.
112
+ ```
113
+
114
+ The footer is appended **by the command's output template** as a
115
+ literal string — it is not generated by the model and has no opt-out
116
+ flag. For `/post-as:me` the footer is omitted entirely (the user is
117
+ the author).
118
+
119
+ ### 6. Print the draft
120
+
121
+ Print the fenced markdown block. No commit, no save, no file write.
122
+ The user copies the output manually. The engine performs no side
123
+ effects on disk.
124
+
125
+ ## Rules
126
+
127
+ - **No `--no-disclosure` flag.** For any ghostwriter consumer, the
128
+ footer is mandatory and deterministic. `task lint-skills` greps the
129
+ ghostwriter command sources for the literal string `no-disclosure`
130
+ and fails CI on a hit.
131
+ - **No multi-voice draft in v1.** One style source per invocation;
132
+ blending voices is deferred.
133
+ - **No file writes.** The engine prints; the user copies. Saving the
134
+ output to `agents/` or anywhere else is a future feature.
135
+
136
+ ## See also
137
+
138
+ - [`ghostwriter-schema`](ghostwriter-schema.md) — the source schema
139
+ for `/ghostwriter:write`.
140
+ - [`agent-user-schema`](agent-user-schema.md) — the source schema
141
+ for `/post-as:me`.
142
+ - [`command-clusters`](command-clusters.md) — cluster registration.
@@ -0,0 +1,89 @@
1
+ # Getting started — by role
2
+
3
+ > Pick the entry that matches what you do day-to-day. Each section names the three skills you will reach for first and shows whether MCP (no terminal) or CLI (terminal) is the simpler install path for that role.
4
+
5
+ `agent-config` ships ~210 skills, ~67 rules, and ~124 commands. You do not need all of them. Each role below filters to the slice that pays back in week one; the rest stays available and shows up on demand when a task references it.
6
+
7
+ > **Eval-gated messaging note.** Until `task bench --corpus non-dev` reports `selection_accuracy >= 0.60` (step-12 Phase 1 exit), this page is documentation, not marketing. The skills listed below are the candidates the corpus tests against; their description quality is what the eval validates. See [`agents/roadmaps/step-12-universal-os-reframe.md`](../agents/roadmaps/step-12-universal-os-reframe.md).
8
+
9
+ ---
10
+
11
+ ## Creator (writer, marketer, indie content shop)
12
+
13
+ **You want this if:** you draft blog posts, marketing emails, launch copy, or release announcements and want a writing assistant that holds a defined brand voice across surfaces. You need brand-voice discipline more than code-quality enforcement. You will spend most of your time in Claude Desktop / ChatGPT, not in a terminal.
14
+
15
+ - [`voice-and-tone-design`](../.agent-src/skills/voice-and-tone-design/SKILL.md) — define and audit brand voice (voice attributes, tone-by-context matrix).
16
+ - [`messaging-architecture`](../.agent-src/skills/messaging-architecture/SKILL.md) — primary message + supporting proofs + audience-by-message matrix.
17
+ - [`editorial-calendar`](../.agent-src/skills/editorial-calendar/SKILL.md) — evergreen vs campaign vs reactive cadence across channels.
18
+
19
+ **Install path:** **MCP recommended.** Claude Desktop is the lowest-friction entry; no terminal required. See [`docs/mcp.md`](mcp.md). CLI install works too if you already use a code editor.
20
+
21
+ ---
22
+
23
+ ## Founder (early-stage operator wearing every hat)
24
+
25
+ **You want this if:** you switch between investor pitch, hiring decision, product spec, and unit-economics modeling in the same week. You need cross-domain skills that respect your time budget, not depth-first specialists. Decisions need to be defensible to a board.
26
+
27
+ - [`runway-cognition`](../.agent-src/skills/runway-cognition/SKILL.md) — cash runway, burn shape, fundraise triggers, cut-vs-grow.
28
+ - [`unit-economics-modeling`](../.agent-src/skills/unit-economics-modeling/SKILL.md) — CAC, LTV, payback, contribution margin per customer.
29
+ - [`fundraising-narrative`](../.agent-src/skills/fundraising-narrative/SKILL.md) — why-now / why-us / why-this framing, market-size reasoning.
30
+
31
+ **Install path:** **MCP for advisory work, CLI when you touch code.** Claude Desktop covers strategy / finance / narrative; CLI is needed only when you sit in the repo with the dev team.
32
+
33
+ ---
34
+
35
+ ## Developer (the original audience)
36
+
37
+ **You want this if:** you write code daily — Laravel, Symfony, Next.js, Node, or stack-agnostic — and want testing / quality / git / CI guardrails baked into the agent's behavior. You will use commands like `/work`, `/commit`, `/create-pr`, `/quality-fix` constantly.
38
+
39
+ - [`laravel`](../.agent-src/skills/laravel/SKILL.md) — Laravel-flavored PHP (Eloquent, Artisan, FormRequests, jobs, policies). See [`docs/getting-started-laravel.md`](getting-started-laravel.md) for the deep dive.
40
+ - [`nextjs-patterns`](../.agent-src/skills/nextjs-patterns/SKILL.md) — App Router, Server Components, Server Actions, caching.
41
+ - [`quality-tools`](../.agent-src/skills/quality-tools/SKILL.md) — PHPStan, Rector, ECS error triage and fix loop.
42
+
43
+ **Install path:** **CLI.** Run `npx @event4u/agent-config init --tools=claude-code,cursor` in the project root. MCP works too but loses git / file-system tooling that the IDE-integrated path gives you.
44
+
45
+ ---
46
+
47
+ ## Consultant (advisory, freelance, fractional)
48
+
49
+ **You want this if:** you sell discovery, positioning, competitive analysis, or roadmap audits. Output is briefs and slide content for a client, not code. You need defensible methodology behind every deliverable.
50
+
51
+ - [`discovery-interview`](../.agent-src/skills/discovery-interview/SKILL.md) — switch-event JTBD guides, bias audit, falsifiable hypothesis.
52
+ - [`competitive-moat-analysis`](../.agent-src/skills/competitive-moat-analysis/SKILL.md) — moat reasoning, where-to-play / where-not-to-play.
53
+ - [`stakeholder-tradeoff`](../.agent-src/skills/stakeholder-tradeoff/SKILL.md) — per-lens framing, trade-off matrix with cost per choice.
54
+
55
+ **Install path:** **MCP recommended.** Most consulting work is doc + slide drafting; the terminal adds friction without payback. Switch to CLI only if you also write code for the client.
56
+
57
+ ---
58
+
59
+ ## Go-To-Market (sales, marketing ops, RevOps)
60
+
61
+ **You want this if:** you own pipeline shape, forecast accuracy, launch sequencing, or post-launch comms. You need deal-level rigor (MEDDIC, exit criteria) and narrative skills (release comms, messaging) in the same agent.
62
+
63
+ - [`pipeline-strategy`](../.agent-src/skills/pipeline-strategy/SKILL.md) — stage exit criteria, per-cell conversion, leak diagnosis.
64
+ - [`deal-qualification-meddic`](../.agent-src/skills/deal-qualification-meddic/SKILL.md) — MEDDIC slots with evidence, inversion test, disqualification heuristic.
65
+ - [`release-comms`](../.agent-src/skills/release-comms/SKILL.md) — value-not-feature framing, audience-segmented surfaces.
66
+
67
+ **Install path:** **MCP recommended.** GTM artifacts are documents, decks, and Notion pages; Claude Desktop is the natural home.
68
+
69
+ ---
70
+
71
+ ## Finance / Ops (CFO, controller, ops lead, founder-finance)
72
+
73
+ **You want this if:** you build forecasts, model scenarios, and review data-handling for compliance. You need the agent to keep accounting / regulatory framing straight, not invent numbers.
74
+
75
+ - [`forecasting`](../.agent-src/skills/forecasting/SKILL.md) — top-down vs bottom-up shape, confidence bands, retro-loop.
76
+ - [`scenario-modeling`](../.agent-src/skills/scenario-modeling/SKILL.md) — base / upside / downside, three-statement modeling, sensitivity.
77
+ - [`privacy-review`](../.agent-src/skills/privacy-review/SKILL.md) — GDPR / CCPA / HIPAA fit, cross-border transfer, breach-impact triage.
78
+
79
+ **Install path:** **MCP recommended.** Finance / ops workflows are spreadsheet- and document-heavy; the CLI buys nothing here unless you also export models into a code repo.
80
+
81
+ ---
82
+
83
+ ## What is the same regardless of role
84
+
85
+ A short universal-skills allowlist (`git`, `refine-ticket`, `proofread`, `threat-model`, etc.) loads in every profile. The list will live at `docs/contracts/universal-skills.md` once step-12 Phase 3 lands; until then the package loads all skills and the host agent's semantic search picks what the prompt needs.
86
+
87
+ ## What this page does not promise
88
+
89
+ This page lists **candidate** skill / role pairings. Whether each skill's `description:` is sharp enough for the agent to retrieve it without manual hint is exactly what `tests/eval/corpus-non-dev.yaml` tests. If a prompt in your role above falls flat, that is a skill-description bug — file an issue or open a PR with a sharper description, do not work around it by naming the skill manually.
@@ -0,0 +1,72 @@
1
+ # Getting started — Laravel
2
+
3
+ > Laravel is the deepest reference stack in the package today. This page collects the Laravel-specific guidance previously embedded in the root README. The relocation is part of step-12 Phase 2; the root README continues to surface Laravel under the dev role until the Phase 6 identity rewrite lands.
4
+
5
+ ## Why Laravel is the reference stack
6
+
7
+ Laravel ships with the broadest, battle-tested skill coverage in the package — Pest, PHPStan, Rector, Eloquent, Livewire / Flux, Horizon, Pulse, Reverb, Pennant. That coverage exists because the package was originally extracted from a Laravel monorepo (Galawork). Symfony and Next.js are the second tier (`symfony-workflow`, `nextjs-patterns`); other stacks ship as they are battle-tested, not second-class.
8
+
9
+ ## Laravel-flavored skills
10
+
11
+ | Skill | What it covers |
12
+ |---|---|
13
+ | [`laravel`](../.agent-src/skills/laravel/SKILL.md) | Eloquent, Artisan controllers, FormRequests, jobs, events, policies, providers |
14
+ | [`eloquent`](../.agent-src/skills/eloquent/SKILL.md) | Models, relationships, scopes, query patterns |
15
+ | [`artisan-commands`](../.agent-src/skills/artisan-commands/SKILL.md) | Console command structure, signatures, safe execution |
16
+ | [`jobs-events`](../.agent-src/skills/jobs-events/SKILL.md) | Queued workflows, listeners, retry / failure handling |
17
+ | [`laravel-validation`](../.agent-src/skills/laravel-validation/SKILL.md) | Form Requests, rules, custom rule objects |
18
+ | [`laravel-middleware`](../.agent-src/skills/laravel-middleware/SKILL.md) | Request / response filtering, groups, priority |
19
+ | [`laravel-notifications`](../.agent-src/skills/laravel-notifications/SKILL.md) | Mail, Slack, database, custom channels |
20
+ | [`laravel-mail`](../.agent-src/skills/laravel-mail/SKILL.md) | Mailables, Markdown templates, queued sending |
21
+ | [`laravel-scheduling`](../.agent-src/skills/laravel-scheduling/SKILL.md) | Cron expressions, overlap prevention, maintenance mode |
22
+ | [`laravel-horizon`](../.agent-src/skills/laravel-horizon/SKILL.md) | Worker supervision, job metrics, balancing strategies |
23
+ | [`laravel-pulse`](../.agent-src/skills/laravel-pulse/SKILL.md) | Real-time dashboard, custom recorders, performance insights |
24
+ | [`laravel-reverb`](../.agent-src/skills/laravel-reverb/SKILL.md) | First-party WebSocket server, Pusher protocol compatibility |
25
+ | [`laravel-pennant`](../.agent-src/skills/laravel-pennant/SKILL.md) | Feature flags, gradual rollouts, A/B testing |
26
+
27
+ ## Quality pipeline
28
+
29
+ The Laravel quality pipeline runs PHPStan + Rector + ECS, with Pest as the test runner:
30
+
31
+ - [`quality-tools`](../.agent-src/skills/quality-tools/SKILL.md) — PHPStan output triage, Rector apply, ECS fix.
32
+ - [`pest-testing`](../.agent-src/skills/pest-testing/SKILL.md) — Pest test authoring patterns.
33
+ - [`/quality-fix`](../.agent-src/commands/quality-fix.md) — runs the full pipeline and fixes reported errors.
34
+
35
+ ## Docker and dev environment
36
+
37
+ - [`docker`](../.agent-src/skills/docker/SKILL.md) — Dockerfile, compose, dual-container (fast + Xdebug) setup.
38
+ - [`php-debugging`](../.agent-src/skills/php-debugging/SKILL.md) — Xdebug breakpoints, dual-container, header-based routing.
39
+ - [`traefik`](../.agent-src/skills/traefik/SKILL.md) — local reverse proxy, real domains on 127.0.0.1, mkcert HTTPS.
40
+
41
+ ## Multi-tenancy and database
42
+
43
+ - [`multi-tenancy`](../.agent-src/skills/multi-tenancy/SKILL.md) — customer DB switching, FQDN routing, tenant isolation.
44
+ - [`database`](../.agent-src/skills/database/SKILL.md) — MariaDB / MySQL tuning, indexing, multi-connection patterns.
45
+ - [`sql-writing`](../.agent-src/skills/sql-writing/SKILL.md) — raw SQL, parameterization, raw migrations.
46
+
47
+ ## Project analysis
48
+
49
+ - [`project-analysis-laravel`](../.agent-src/skills/project-analysis-laravel/SKILL.md) — boot flow, request lifecycle, container usage, async systems, Laravel-specific failure patterns.
50
+
51
+ ## Install for a Laravel project
52
+
53
+ ```bash
54
+ cd path/to/your/laravel/app
55
+ npx @event4u/agent-config init --tools=claude-code,cursor
56
+ ```
57
+
58
+ The installer detects `composer.json` + `artisan` + the Laravel framework dependency, enables stack-aware skills, and writes `.agent-settings.yml` with sensible defaults. The first `/onboard` run captures your name, preferred IDE, and cost profile.
59
+
60
+ ## Other PHP stacks
61
+
62
+ | Stack | Coverage |
63
+ |---|---|
64
+ | **Symfony** | [`symfony-workflow`](../.agent-src/skills/symfony-workflow/SKILL.md) — DI, Doctrine, Messenger, voters, Twig; [`project-analysis-symfony`](../.agent-src/skills/project-analysis-symfony/SKILL.md) |
65
+ | **Zend / Laminas** | [`project-analysis-zend-laminas`](../.agent-src/skills/project-analysis-zend-laminas/SKILL.md) + shared PHP coder / quality skills |
66
+ | **Framework-free PHP** | [`php-coder`](../.agent-src/skills/php-coder/SKILL.md) — modern idioms, SOLID refactors, type hints without framework lock-in |
67
+
68
+ ## See also
69
+
70
+ - [`docs/getting-started-by-role.md`](getting-started-by-role.md) — pick the entry that matches your day-to-day.
71
+ - [`docs/getting-started.md`](getting-started.md) — generic three-step quickstart.
72
+ - [`docs/installation.md`](installation.md) — detailed install variants (npx, curl, global npm).
@@ -106,7 +106,7 @@ Your agent is now:
106
106
  - **Respecting your codebase** — no conflicting patterns
107
107
  - **Following standards** — consistent code quality
108
108
 
109
- This is enforced automatically by 67 rules. No configuration needed.
109
+ This is enforced automatically by 79 rules. No configuration needed.
110
110
 
111
111
  ---
112
112
 
@@ -146,7 +146,7 @@ Your agent now understands slash commands:
146
146
  | `/quality-fix` | Run and fix all quality checks |
147
147
  | `/chat-history` | Inspect the persistent chat-history log (read-only `show`) |
148
148
 
149
- → [Browse all 115 active commands](../.agent-src/commands/)
149
+ → [Browse all 124 active commands](../.agent-src/commands/)
150
150
 
151
151
  ---
152
152
 
@@ -235,6 +235,57 @@ The global install puts `agent-config` on `$PATH` so the project
235
235
  wrapper (`./agent-config`) can fall through to it when no
236
236
  `node_modules/@event4u/agent-config/` exists.
237
237
 
238
+ ### Global CLI + per-project settings (minimal flow)
239
+
240
+ For teams that want to keep the runtime global (one install per
241
+ machine) but still version a per-project `.agent-settings.yml` and a
242
+ project-local `agents/` folder, use the `--minimal` init:
243
+
244
+ ```bash
245
+ # 1. Install the runtime once per machine
246
+ npm install -g @event4u/agent-config
247
+
248
+ # 2. Inside the project, write only the per-project shell
249
+ agent-config init --minimal
250
+ # or, without a global install:
251
+ npx @event4u/agent-config init --minimal
252
+ ```
253
+
254
+ `--minimal` writes exactly three files into the project root:
255
+
256
+ - `.agent-settings.yml` — per-project cost profile, member config,
257
+ feature flags. Committed.
258
+ - `agents/.gitkeep` — placeholder so the directory is committed
259
+ before the first roadmap, decision, or council session lands.
260
+ - `./agent-config` — bash wrapper that pins
261
+ `AGENT_CONFIG_PROJECT_ROOT` to the project root and forwards every
262
+ subcommand to the globally installed CLI. Committed.
263
+
264
+ Nothing else — no `.augment/`, no `.claude/`, no `.cursor/`, no
265
+ `AGENTS.md`. The shipped tool payload stays in the user's home (or
266
+ the npx cache) and is shared across every project on the machine.
267
+
268
+ #### Decision table — `--minimal` vs full `init`
269
+
270
+ | Pick `--minimal` when | Pick full `init` when |
271
+ |---|---|
272
+ | Runtime is already installed globally (`npm i -g`). | First-time setup on a fresh machine. |
273
+ | Team wants one source of truth for skills / rules / commands across every repo (shared via the global install). | Team wants per-repo skills / rules / commands committed alongside the code. |
274
+ | `agents/` content (roadmaps, decisions) is the only per-project state worth committing. | `AGENTS.md`, `GEMINI.md`, or `.github/copilot-instructions.md` need project-specific overrides. |
275
+ | The repo runs in CI and you do not want to vendor the full payload. | The repo cannot rely on a global install (air-gapped, sandboxed CI without npm). |
276
+ | Migrating an existing project from the legacy `.git`-anchored install. | Starting a new project that has never seen `agent-config`. |
277
+
278
+ Nested-install guard: `init --minimal` refuses to run when an
279
+ ancestor already contains an anchor (`.git`, an `agents/` directory
280
+ with a marker, or another `.agent-settings.yml`). This prevents
281
+ shadow installs inside an existing project. Override with explicit
282
+ `--target <dir>` if the nesting is intentional.
283
+
284
+ `--minimal` does **not** pin `agent_config_version` — the project
285
+ follows whichever version the global CLI was installed at. Pin
286
+ explicitly by adding `agent_config_version: <semver>` to
287
+ `.agent-settings.yml` when you want a reproducible runtime.
288
+
238
289
  ### Installer orchestrator (`scripts/install`)
239
290
 
240
291
  The orchestrator chains payload sync and bridge generation:
@@ -673,8 +724,176 @@ or sandbox testing:
673
724
  - `AGENT_CONFIG_NO_EVENTS_LOG=1` — disables every write to
674
725
  `agents/council-events.log` in-process. Quota counter and council
675
726
  output stay untouched.
676
- - `AGENT_CONFIG_LEGACY_ANCHOR=1` — opt back into the pre-step-7
677
- legacy-anchor behaviour for `.agent-settings.yml` migration.
727
+ - `AGENT_CONFIG_LEGACY_ANCHOR=1` — reverts project-root discovery to
728
+ the pre-step-7 `.git`-only walk. See [Migration — Step 7 anchor
729
+ discovery](#migration--step-7-anchor-discovery) below for the
730
+ precedence rules and when to use this.
731
+ - `AGENT_CONFIG_PROJECT_ROOT=<abs-path>` — pins the resolved project
732
+ root, skipping the anchor walk entirely. Set automatically by the
733
+ `./agent-config` wrapper; set manually in CI when the working
734
+ directory is not a descendant of the project root.
735
+
736
+ ---
737
+
738
+ ## Migration — Step 7 anchor discovery
739
+
740
+ Before Step 7, the CLI located the project root by walking up for a
741
+ `.git` directory only. Step 7 widens the anchor set so non-git
742
+ projects (sparse checkouts, monorepo sub-trees, `agent-config`-only
743
+ worktrees) resolve correctly and so subdirectory invocations stop
744
+ falling back to `cwd`.
745
+
746
+ ### Anchor precedence (D3 — cascade-conflict decision)
747
+
748
+ Walk up from CWD. The first ancestor containing a **boundary
749
+ anchor** wins:
750
+
751
+ 1. `.git` (file or directory).
752
+ 2. `agents/` directory containing **any** of `roadmaps/`,
753
+ `.ai-council.yml`, or `roadmaps-progress.md` — bare `agents/`
754
+ does **not** anchor (D1).
755
+
756
+ If no boundary anchor exists in any ancestor, the **outermost**
757
+ (closest-to-fs-root) `.agent-settings.yml` becomes the root. This
758
+ preserves the layered-settings cascade — see
759
+ [`agents/council-sessions/step-7-d3-cascade-conflict-decision.md`](../agents/council-sessions/step-7-d3-cascade-conflict-decision.md)
760
+ for the rationale.
761
+
762
+ When a single ancestor carries multiple anchors, the **diagnostic
763
+ anchor name** reported by `agent-config doctor` follows the D3
764
+ tie-break order (`.agent-settings.yml` > `agents/` > `.git`). The
765
+ resolved path is identical either way.
766
+
767
+ ### Resolution precedence (which root wins)
768
+
769
+ In order, first match wins (Step 8 adds the `--root` flag at the top):
770
+
771
+ 1. Global `--root <dir>` flag (Step 8) — escape hatch for monorepos.
772
+ 2. Explicit `--project <dir>` / `--target <dir>` on the CLI.
773
+ 3. `AGENT_CONFIG_PROJECT_ROOT=<abs-path>` env var.
774
+ 4. Anchor walk from CWD (rules above).
775
+ 5. Fallback to CWD.
776
+
777
+ The `./agent-config` wrapper sets step 3 to its own directory, so
778
+ subcommands invoked from a subdirectory still target the right root
779
+ even after `os.chdir`.
780
+
781
+ ### Project-root override — `--root` (Step 8)
782
+
783
+ The global `--root <dir>` flag pins discovery to a specific directory.
784
+ It is parsed by the bash dispatcher **before** any subcommand and beats
785
+ every other channel, including the wrapper-pinned env var:
786
+
787
+ ```bash
788
+ # Run doctor against a sibling project from anywhere
789
+ agent-config --root /work/projects/site-a doctor --context
790
+
791
+ # Equivalent — long-form `=` syntax
792
+ agent-config --root=/work/projects/site-a doctor --context
793
+ ```
794
+
795
+ **Fail-loud validation.** Invalid paths exit with code `2` instead of
796
+ silently falling back to CWD:
797
+
798
+ ```text
799
+ ❌ agent-config: --root points to a path that does not exist: /nope
800
+ ```
801
+
802
+ The same validation applies to `--project` and
803
+ `AGENT_CONFIG_PROJECT_ROOT` — every explicit override is checked.
804
+
805
+ **Wrapper coupling.** When the project-local `./agent-config` wrapper
806
+ runs, it pins `AGENT_CONFIG_PROJECT_ROOT` to its own directory. The
807
+ `--root` flag explicitly overrides that pin (the wrapper logs a stderr
808
+ hint when this happens), so monorepo sub-trees can target one another
809
+ without unpinning the wrapper.
810
+
811
+ ### Monorepo semantics
812
+
813
+ Monorepos with multiple `agent-config` consumers (e.g. one package per
814
+ sub-tree) work out of the box because the anchor walk stops at the
815
+ **nearest** boundary anchor (`agents/<markers>` or `.git`). From inside
816
+ `packages/site-a/`, discovery resolves to `packages/site-a/`, not the
817
+ monorepo root.
818
+
819
+ When you need to invoke a sibling package's CLI from anywhere, use
820
+ `--root`:
821
+
822
+ ```bash
823
+ # From the monorepo root, target site-b
824
+ agent-config --root packages/site-b validate
825
+
826
+ # From inside site-a, run a sync against site-b
827
+ agent-config --root ../site-b sync
828
+ ```
829
+
830
+ `--root` is the recommended channel — explicit, fail-loud, and visible
831
+ in `doctor --context` output. Setting `AGENT_CONFIG_PROJECT_ROOT`
832
+ manually still works but is less discoverable.
833
+
834
+ ### Diagnostics — `doctor --trace-root` and `--context`
835
+
836
+ Two read-only diagnostic flags surface how discovery resolved the
837
+ project root:
838
+
839
+ ```bash
840
+ # Show every ancestor probed + winning anchor
841
+ agent-config doctor --trace-root
842
+
843
+ # Show effective root, origin, install mode, settings layers, wrapper
844
+ agent-config doctor --context
845
+ ```
846
+
847
+ Sample `--trace-root` output:
848
+
849
+ ```text
850
+ 📍 start: /work/projects/site-a/src
851
+ 📍 origin: agents-dir
852
+ trace:
853
+ · [boundary] /work/projects/site-a/src (no .git, no agents/)
854
+ ✅ [boundary] /work/projects/site-a → agents-dir (agents/ has roadmaps/)
855
+ 📍 resolved root: /work/projects/site-a (anchor: agents-dir)
856
+ ```
857
+
858
+ Sample `--context` output:
859
+
860
+ ```text
861
+ 📍 project_root: /work/projects/site-a (origin: agents-dir)
862
+ 📦 install_mode: full (source: marker-file)
863
+
864
+ ```
865
+
866
+ Both flags accept `--json` for machine-readable output. The
867
+ `install_mode_source` is `marker-file` when
868
+ `agents/.agent-state/install-mode.txt` exists (written by the
869
+ installer since Step 8) and `heuristic` for back-compat installs.
870
+
871
+ ### When to set `AGENT_CONFIG_LEGACY_ANCHOR=1`
872
+
873
+ Set this only as a temporary escape hatch — for example, when the
874
+ new anchor set surfaces an unexpected ancestor in a CI pipeline that
875
+ already passes the legacy walk. Behaviour:
876
+
877
+ - Walk up for `.git` only (Step-6 behaviour).
878
+ - `agents/` and `.agent-settings.yml` are ignored as anchors.
879
+ - Cascade order is unchanged — layered `.agent-settings.yml` files
880
+ still merge.
881
+
882
+ The kill-switch is scheduled for removal after one minor-version
883
+ soak (D5). File an issue if you need it longer-term so the precedence
884
+ table can absorb the missing case.
885
+
886
+ ### Verifying the resolved root
887
+
888
+ ```bash
889
+ agent-config doctor --context
890
+ ```
891
+
892
+ prints the resolved project root, origin (`root-flag` / `explicit` /
893
+ `env` / anchor name / `cwd-fallback`), install mode, settings-layer
894
+ chain, and wrapper state. Use this when a command appears to read the
895
+ wrong `.agent-settings.yml`. Pair with `--trace-root` (above) when the
896
+ **anchor walk itself** needs debugging.
678
897
 
679
898
  ---
680
899
 
package/docs/safety.md ADDED
@@ -0,0 +1,30 @@
1
+ # Data governance & domain safety
2
+
3
+ `agent-config` ships **12 domain-safety rules** (`.agent-src.uncompressed/rules/domain-safety-*.md`) that act as a per-domain output floor — PII redaction, disclaimer requirements, and retention guidance. Rules fire automatically via the router when their triggers match.
4
+
5
+ ## Surface → rule(s) → floor
6
+
7
+ | Surface | Rule(s) | Floor |
8
+ |---|---|---|
9
+ | Support / CRM drafts | `domain-safety-pii-support` · `domain-safety-retention-support` | Redact customer names, emails, phones, account IDs to placeholders before output |
10
+ | Finance / invoicing | `domain-safety-pii-finance` · `domain-safety-retention-finance` | Redact counterparty PII and bank identifiers; flag retention under audit hold |
11
+ | Recruiting | `domain-safety-pii-recruiting` | Redact candidate PII from notes, scorecards, rejection emails |
12
+ | Marketing testimonials | `domain-safety-pii-marketing` | Require consent record before customer-identifying copy ships |
13
+ | Legal · financial · medical · consulting drafts | `domain-safety-disclaimer-*` | "Not legal/financial/medical advice" disclaimers; refuse diagnostic / dosage / specific tax positions |
14
+ | Logs · exports | `domain-safety-logging-pii-floor` · `domain-safety-export-redact` | No raw PII in logs or exports; allowlist-driven structured fields only |
15
+
16
+ ## How the floor is enforced
17
+
18
+ - Each rule declares `applies_to_user_types:` in frontmatter — rules load only when the matching user-type is active (forward-compatible with the user-types axis shipping in `step-9-user-types-axis`).
19
+ - Each rule routes to `skill:privacy-review` as the baseline deeper-regime check (GDPR · CCPA · HIPAA).
20
+ - The set is opt-in by domain, never overrides higher Iron Laws (`non-destructive-by-default`, `commit-policy`, `scope-control`).
21
+
22
+ ## Related skills
23
+
24
+ - [`privacy-review`](../.agent-src.uncompressed/skills/privacy-review/SKILL.md) — end-to-end data-flow review for a regulatory regime (GDPR / CCPA / HIPAA).
25
+ - [`data-handling-judgment`](../.agent-src.uncompressed/skills/data-handling-judgment/SKILL.md) — classification, retention, cross-border transfer, DSR workflow.
26
+
27
+ ## See also
28
+
29
+ - [`non-destructive-by-default`](../.augment/rules/non-destructive-by-default.md) — Hard Floor that overrides every domain-safety carve-out.
30
+ - [`security-sensitive-stop`](../.augment/rules/security-sensitive-stop.md) — threat-model before touching auth / billing / tenant boundaries / uploads.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event4u/agent-config",
3
- "version": "2.15.0",
3
+ "version": "2.17.0",
4
4
  "description": "Shared agent configuration \u2014 skills, rules, commands, guidelines, and templates for AI coding tools",
5
5
  "license": "MIT",
6
6
  "private": false,