@topy-ai/maggie 0.7.61 → 0.8.1

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 (29) hide show
  1. package/README-zh-TW.md +2 -2
  2. package/README.md +5 -5
  3. package/bundled-references/agent-goal-design.md +92 -0
  4. package/bundled-skills/catalog.json +4 -0
  5. package/bundled-skills/maggie-deployment/SKILL.md +21 -1
  6. package/bundled-skills/maggie-design/SKILL.md +29 -1
  7. package/bundled-skills/maggie-security/SKILL.md +10 -2
  8. package/bundled-skills/maggie-security/references/commands.md +10 -3
  9. package/bundled-skills/maggie-security/references/explaining-findings.md +7 -0
  10. package/bundled-skills/maggie-security/references/tools-and-licences.md +8 -0
  11. package/bundled-skills/maggie-security/registry/security-tools.registry.json +748 -652
  12. package/bundled-skills/maggie-spirit/SKILL.md +128 -0
  13. package/bundled-tools/clis/maggie_dash.py +12 -4
  14. package/bundled-tools/clis/maggie_security.py +1 -1
  15. package/bundled-tools/clis/maggie_security_code.py +49 -1
  16. package/bundled-tools/clis/maggie_security_deps.py +95 -0
  17. package/bundled-tools/clis/maggie_security_mcp.py +67 -1
  18. package/bundled-tools/clis/maggie_security_report.py +31 -2
  19. package/bundled-tools/clis/maggie_security_scan.py +168 -0
  20. package/bundled-tools/clis/maggie_security_web.py +45 -1
  21. package/bundled-tools/clis/maggie_spirit.py +143 -0
  22. package/bundled-tools/clis/security_data/tools.lock.json +36 -7
  23. package/bundled-tools/runtime/maggie_dash_pg.py +126 -0
  24. package/bundled-tools/runtime/maggie_dash_store.py +17 -5
  25. package/bundled-tools/runtime/spirit_agent.py +262 -0
  26. package/bundled-tools/runtime/spirit_base.py +256 -0
  27. package/bundled-tools/runtime/spirit_face.py +222 -0
  28. package/package.json +1 -1
  29. package/references/agent-goal-design.md +92 -0
package/README-zh-TW.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English README](README.md) · [完整繁體中文 README](https://github.com/TOPY-AI-LTD/ai-cmo-skills/blob/main/README.zh-TW.md)
4
4
 
5
- `@topy-ai/maggie` 提供 20 個可安裝的 AI website workflow skills,支援
5
+ `@topy-ai/maggie` 提供 24 個可安裝的 AI website workflow skills,支援
6
6
  Codex、Claude Code 與相容的 coding agents。
7
7
 
8
8
  ## 安裝
@@ -143,7 +143,7 @@ structure drift 或重複 treatment product 時 fail closed。
143
143
  deployment、memory、feedback 和 MaggieDash。內容先 draft/review,外部寫入、
144
144
  publish 與 production deployment 需要明確確認。
145
145
 
146
- 目前 npm 版本為 `0.7.61`,包含 fix-plan 修補風險分級 T1–T4(判斷補丁是否安全套用)與 host-impact 補丁影響面量測(哪些服務需重啟、是否需重開機)、public-check、Maggie Security、batch 31 排程 agent routines、報告收件匣與無人值守 agent 限制、PHP runtime 盤點與主機鎖、pull 網站改寫、query 點子與社群佇列檢查,batch 30 MaggieDash 先裝核心、release privacy gate、feedback 備援、社群連結與圖片檢查、大量頁面產生與 app 檢查,batch 29 預約規則、部署、app QA、助理與社群功能,以及 batch 28 產品 app、assistant tools、mobile、product release、skills catalog 與 bridge host 功能、batch 26、27 feedback 修正與 idempotent `maggie update`與 Booking email-template 合約/CLI validator 同步。本版完成 2026-09-24 booking feedback batch:Calendar grid/free-slot entry 與 host modal focus-restoration evidence。本版新增 Starter marketplace provisioning plan;本版完成 feedback batches 22、23:加入 declarative browser interaction evidence、design markup/style/content-key gate、compiler source anchoring、entity double-escape protection、`update --help` read-only、noindex hypothetical indexability、可過期 baseline acknowledgement、DOM-only link extraction regression,以及 MaggieDash 0.2.10 的 content override、短期 browser session、CDN-safe public-session cache contracts。authentication 和 isolated dev server 仍由 host 負責。`maggie-booking` workflow、傳統 email/password、Stripe、Resend、public booking flow 及既有安全邊界維持不變;provider-bound video generation 與 transactional delivery 仍記錄在 issue #39,前一批延後功能仍在 issue #38,不會直接成為 active memory。0.7.33 記錄並審查一筆更正回饋;確認 0.7.32 已正確處理 batch index,沒有修改已驗證的 shared behavior。0.7.32 加入 feedback 一基索引支援、MaggieDash panel 的 source/freshness/error evidence、Consent Mode 與實際 write/no-op reconciliation、SEO baseline recapture、sitemap origin rebasing、content-diff scope、migration ledger reconciliation、deployment credential preflight、release provenance/runtime preflight、icon release gate、opt-in blog auto-publish gate,以及 least-privilege VPS deployer。也修復 top-level `maggie feedback` dispatcher parity。0.7.31 加入 update 差異摘要、atomic installer copy、subset install manifest merge,以及 inventory drift 時 doctor non-zero。0.7.30 補上 feedback tracking issue closeout gate 與 batch 14/15 audit ledger。0.7.29 修正 npm package landing page 使用英文 README;0.7.28 加入 versioned Gemini model policy、明確 fallback 與 provenance、bundled-first CLI
146
+ 目前 npm 版本為 `0.8.1`,新增 maggie-spirit(為 AI 品牌生成平面像素 spirit/sprite 系統:logo mark 與各 agent avatar 皆以共用的 32 狀態基礎集播放動畫)與 goal-led AI agent 設計參考,並補上 ONEMAN.APP in-place 開發的部署與設計筆記(靜態站先 build 再部署、Astro 執行期注入節點樣式、in-place DESIGN.md 擷取)。先前 0.8.0 為安全優化 roadmap(scan、image-patch、標頭評分、SSVC、GDPR 日誌規則、新 MCP 工具),含 fix-plan 修補風險分級 T1–T4(判斷補丁是否安全套用)與 host-impact 補丁影響面量測(哪些服務需重啟、是否需重開機)、public-check、Maggie Security、batch 31 排程 agent routines、報告收件匣與無人值守 agent 限制、PHP runtime 盤點與主機鎖、pull 網站改寫、query 點子與社群佇列檢查,batch 30 MaggieDash 先裝核心、release privacy gate、feedback 備援、社群連結與圖片檢查、大量頁面產生與 app 檢查,batch 29 預約規則、部署、app QA、助理與社群功能,以及 batch 28 產品 app、assistant tools、mobile、product release、skills catalog 與 bridge host 功能、batch 26、27 feedback 修正與 idempotent `maggie update`與 Booking email-template 合約/CLI validator 同步。本版完成 2026-09-24 booking feedback batch:Calendar grid/free-slot entry 與 host modal focus-restoration evidence。本版新增 Starter marketplace provisioning plan;本版完成 feedback batches 22、23:加入 declarative browser interaction evidence、design markup/style/content-key gate、compiler source anchoring、entity double-escape protection、`update --help` read-only、noindex hypothetical indexability、可過期 baseline acknowledgement、DOM-only link extraction regression,以及 MaggieDash 0.2.10 的 content override、短期 browser session、CDN-safe public-session cache contracts。authentication 和 isolated dev server 仍由 host 負責。`maggie-booking` workflow、傳統 email/password、Stripe、Resend、public booking flow 及既有安全邊界維持不變;provider-bound video generation 與 transactional delivery 仍記錄在 issue #39,前一批延後功能仍在 issue #38,不會直接成為 active memory。0.7.33 記錄並審查一筆更正回饋;確認 0.7.32 已正確處理 batch index,沒有修改已驗證的 shared behavior。0.7.32 加入 feedback 一基索引支援、MaggieDash panel 的 source/freshness/error evidence、Consent Mode 與實際 write/no-op reconciliation、SEO baseline recapture、sitemap origin rebasing、content-diff scope、migration ledger reconciliation、deployment credential preflight、release provenance/runtime preflight、icon release gate、opt-in blog auto-publish gate,以及 least-privilege VPS deployer。也修復 top-level `maggie feedback` dispatcher parity。0.7.31 加入 update 差異摘要、atomic installer copy、subset install manifest merge,以及 inventory drift 時 doctor non-zero。0.7.30 補上 feedback tracking issue closeout gate 與 batch 14/15 audit ledger。0.7.29 修正 npm package landing page 使用英文 README;0.7.28 加入 versioned Gemini model policy、明確 fallback 與 provenance、bundled-first CLI
147
147
  dispatch、`maggie --version`、feedback batch review 聚合與重複偵測、marketplace enrichment evidence、booking
148
148
  worker/resolver evidence,以及 read-only migration preflight。它也包含 host-owned mobile app surface contract、signed-in
149
149
  camera-state QA、直接 Astro route resolution、correlated feedback batch,以及
package/README.md CHANGED
@@ -87,9 +87,9 @@ Then invoke the installed skills from your coding agent, for example:
87
87
 
88
88
  Maggie keeps the existing project foundation and asks for decisions before
89
89
  shared routes, analytics, or publishing boundaries change. The current
90
- package ships 23 installable skills and a local-first MaggieDash foundation.
90
+ package ships 24 installable skills and a local-first MaggieDash foundation.
91
91
 
92
- This package is `0.7.61` — safe patching. `maggie security fix-plan` tags every action with a **fix-risk tier** T1–T4 — whether a patch is safe to apply, not just what to patch: T1 batch-safe distro/permission fixes, T2 restart+smoke-test, T3 config hardening that validates and auto-rolls-back, T4 major/EOL moves emitted as accepted-risk drafts to stage first. New `maggie security host-impact` (read-only) measures each patch's **blast radius** — which pending updates are security-only, which running services must restart to make a fix live (`needrestart`), and whether a reboot is pending — and feeds it back into the plan.
92
+ This package is `0.8.1` — adds `maggie-spirit` (generate an AI brand's flat-pixel spirit/sprite system: a logo mark plus per-agent avatars animated through a shared 32-state base set) and a goal-led AI agent design reference, plus deployment and design notes from the ONEMAN.APP in-place build (static-site build-before-deploy, Astro runtime-injected DOM styling, in-place DESIGN.md extraction).
93
93
 
94
94
  The 0.7.59 release made `maggie security host-audit` (the deep
95
95
  lynis audit over SSH) robust on hosts where a storage test can stall: lynis runs
@@ -111,7 +111,7 @@ interactive-only and never probes, submits or scans; the active scanners
111
111
  (`web-scan`, `zap-baseline`) and host checks stay verified-only.
112
112
 
113
113
  The 0.7.56 release added Maggie Security, a new
114
- `maggie-security` skill and `maggie security` command family (49 commands, 30
114
+ `maggie-security` skill and `maggie security` command family (51 commands, 35
115
115
  MCP tools, 7 contracts under `contracts/maggie-security/`).
116
116
 
117
117
  - **Advisories for the whole stack.** Packages (npm, pnpm, Yarn, Bun,
@@ -858,8 +858,8 @@ artifact schemas.
858
858
  Recommended upgrade sequence for the current release:
859
859
 
860
860
  ```bash
861
- npx @topy-ai/maggie@0.7.61 update --scope project --project . --force
862
- npx @topy-ai/maggie@0.7.61 cleanup --scope project --project .
861
+ npx @topy-ai/maggie@0.8.0 update --scope project --project . --force
862
+ npx @topy-ai/maggie@0.8.0 cleanup --scope project --project .
863
863
  ```
864
864
 
865
865
  Maintainers should pass npm credentials through the repository helper, never
@@ -0,0 +1,92 @@
1
+ # Goal-led AI agent design
2
+
3
+ A reusable method for defining the agents in a multi-agent product so a single
4
+ human can run a company by stating intent, not by operating tools. Distilled
5
+ from the ONEMAN.APP cofounder build; pairs with the `maggie-spirit` skill (give
6
+ each designed agent a spirit/avatar) and `maggie-assistant-tools` (expose an
7
+ agent's capabilities safely).
8
+
9
+ ## Principle
10
+
11
+ The human sets a **goal**; the agents turn it into work and keep the human in
12
+ the loop only for judgement and approval. Each agent owns one lane, declares the
13
+ **capability classes** it may use, and runs under a **risk ceiling** with
14
+ explicit approval gates. Nothing that is risky, public, or spends money happens
15
+ without a human yes.
16
+
17
+ ## Define each agent with a role contract
18
+
19
+ One `role.yaml` per agent. Recommended fields:
20
+
21
+ ```yaml
22
+ role: CTO # the lane
23
+ name: AI CTO # display name
24
+ persona: Turing # inspiration, not impersonation
25
+ spirit: Engineering # one-word identity (drives the spirit accent/motif)
26
+ summary: > # what it owns, in one or two sentences
27
+ Technical design, build, integrate, test and deploy. Production deployment is
28
+ gated behind human approval.
29
+ responsibilities: [design, build, integrate, test, deploy, observe]
30
+ constraints: [no prod deploy without approval, no secrets in source]
31
+ allowed_capability_classes: [app.scaffold, app.build, app.test, code.review,
32
+ deploy.release, integration.connect, ops.observe, job.execute]
33
+ default_risk_ceiling: L1 # L0 read -> L3 irreversible/public/paid
34
+ business_system: Execution # which paired system (e.g. with COO)
35
+ raci: { new_service_app: "A", security_verdict: I }
36
+ interfaces: { mcp: planned, cli: planned, api: planned }
37
+ ```
38
+
39
+ - **Capability classes**, not freeform skills, are the unit of authority. They
40
+ are stable `area.verb` identifiers (`content.publish`, `revenue.close`,
41
+ `security.scan`) that a UI can list and a gate can check. These are the
42
+ "skills" a product surfaces per agent.
43
+ - **One CEO orchestrates.** The CEO owns `goal.decompose`, `mission.manage`,
44
+ `plan.compose`, `priority.rank`, `outcome.accept`: it turns intent into
45
+ missions with acceptance criteria, delegates each to the right agent, and
46
+ signs off - it never bypasses security or budget approval.
47
+ - **Security holds a non-overridable veto.** A high-risk security verdict cannot
48
+ be overruled by another agent.
49
+ - **Finance is explain-only.** Financial facts come from deterministic data
50
+ (billing/usage ledger, Stripe); the CFO reconciles and advises, it is not the
51
+ source of truth.
52
+
53
+ ## Risk ceilings and approval gates
54
+
55
+ | Level | Meaning | Gate |
56
+ |---|---|---|
57
+ | L0 | read-only | none |
58
+ | L1 | internal writes (drafts, plans, workflows) | logged |
59
+ | L2 | customer-facing or public (publish, close a deal) | human approval |
60
+ | L3 | irreversible / paid / production (deploy, transfer) | human approval + audit |
61
+
62
+ Every agent declares a `default_risk_ceiling`; an action above it stops for an
63
+ explicit human yes. Log every action; make L2/L3 produce an approval card.
64
+
65
+ ## The goal loop
66
+
67
+ 1. The human states what the business should do.
68
+ 2. The CEO writes missions with acceptance criteria.
69
+ 3. Each mission is delegated to the agent whose lane and capability classes fit.
70
+ 4. Agents work their lane; risky/public/paid steps wait for approval.
71
+ 5. The CEO reviews outcomes against the acceptance criteria and signs off, or
72
+ sends the mission back.
73
+ 6. The human stays the only human in the loop - approve, steer, ship.
74
+
75
+ ## Surfacing agents to users
76
+
77
+ Each agent reads cleanly as a profile: persona name, spirit, its capability
78
+ classes (its "skills"), and the service apps it manages. Give it a spirit/avatar
79
+ with `maggie-spirit` (shared 32-state motion vocabulary, per-agent accent) so
80
+ status (idle, working, deploying, success, blocked, secure) reads the same
81
+ across the whole team. Mark an agent "shipped" only when its product is actually
82
+ live.
83
+
84
+ ## Checklist
85
+
86
+ - [ ] One lane per agent; no two agents own the same decision.
87
+ - [ ] Capability classes are `area.verb`, stable, and enumerable.
88
+ - [ ] A single orchestrator (CEO) owns decomposition and sign-off.
89
+ - [ ] Security veto and finance-is-explain-only are encoded, not assumed.
90
+ - [ ] Every agent has a risk ceiling; L2/L3 actions gate on human approval.
91
+ - [ ] Persona is inspiration, not impersonation of a real person.
92
+ - [ ] Each agent has a spirit/avatar from the shared 32-state base set.
@@ -90,6 +90,10 @@
90
90
  "name": "maggie-social-share",
91
91
  "description": "Turn approved AI CMO articles and content assets into platform-native social drafts, scheduled posts, and measured distribution. Use for Social Share planning, LinkedIn/Facebook copy, CTA mapping, calendars, approvals, publish retries, or social performance readback."
92
92
  },
93
+ {
94
+ "name": "maggie-spirit",
95
+ "description": "Generate an AI brand's flat-pixel spirit (sprite) system - a logo mark that animates through a fixed 32-state base set, and per-agent avatar faces animated through the same states. Use for agent/brand avatars, logo marks, sprite-sheet and sprite-animation assets, and a shared motion vocabulary across Core and Service agents."
96
+ },
93
97
  {
94
98
  "name": "maggie-template",
95
99
  "description": "Discover, recommend, inspect, and apply verified Astro homepage templates from the Maggie marketplace. Use when a user wants to start a site from a selected template, compare available designs, or choose a visual direction before maggie-clone or maggie-design."
@@ -2,7 +2,7 @@
2
2
  name: maggie-deployment
3
3
  description: Deploy and operate Maggie blog projects with Cloudflare Workers as the default target, while preserving an adapter boundary for VPS, GCP, and AWS.
4
4
  metadata:
5
- version: 1.6.0
5
+ version: 1.6.1
6
6
  ---
7
7
 
8
8
  # Maggie Deployment
@@ -749,3 +749,23 @@ discovery, install-manifest writes, or file synchronization. For fixture-backed
749
749
  browser QA, the host owns the isolated dev server and data source; document a
750
750
  second port/process and fixture mode in the host runbook instead of making the
751
751
  shared updater or deployment CLI start an unmanaged daemon.
752
+
753
+ ## Static sites: build first, ship the build output only
754
+
755
+ A static-site deploy must run the framework build and ship **only** the build
756
+ output, never the source tree. A pipeline that copies the project directory and
757
+ serves it (for example `rsync webapp/ ...` then `python -m http.server`) exposes
758
+ the source and, with no `index.html` at the root, serves a directory listing
759
+ instead of the site.
760
+
761
+ The deploy step must therefore:
762
+
763
+ 1. install and build in the project (`npm ci && npm run build`), then
764
+ 2. ship only the build artifact (`dist/`, `build/`, `.output/public`, ...) to the
765
+ web root, and
766
+ 3. verify the live root returns the rendered page (a `200` whose body contains
767
+ the expected `<title>`/`<h1>`), not an autoindex.
768
+
769
+ Treat "the root is a directory listing" or "source files (`package.json`,
770
+ `src/`) are reachable over HTTP" as a failed deploy. Prefer a build artifact
771
+ check in CI over trusting that a copy step shipped the right directory.
@@ -2,7 +2,7 @@
2
2
  name: maggie-design
3
3
  description: Design authorized interior pages, review rendered responsive layouts, or explicitly rebrand a packaged homepage/template. Use rebrand only with a named source brand and target brand.
4
4
  metadata:
5
- version: 1.6.0
5
+ version: 1.6.1
6
6
  ---
7
7
 
8
8
  # Maggie Design
@@ -853,3 +853,31 @@ without an explicit host contract. Decode HTML entities exactly once; unknown
853
853
  or double-escaped entities stop the check. Optional empty attributes such as
854
854
  `style=""` must be omitted. Codemods using compiler positions must anchor at
855
855
  the opening `<tag` before slicing source text.
856
+
857
+ ## Front-end pitfalls from in-place builds
858
+
859
+ ### Runtime-injected DOM does not get scoped styles
860
+
861
+ Astro (and other scoped-style systems) add a per-component attribute
862
+ (`data-astro-cid-*`) only to nodes present in the template at build time. Nodes
863
+ you create at runtime with `innerHTML`/`createElement` never receive it, so
864
+ scoped `<style>` rules silently do not match them - a tab, card, or image built
865
+ in script renders unstyled while the identical server-rendered markup looks
866
+ correct. Style runtime-injected content with `<style is:global>` (scoped by an
867
+ id/class you control, e.g. `#my-modal .card { ... }`) or with inline styles.
868
+ Verify with rendered-browser evidence, not a static class scan: the static
869
+ selector exists, but the element it should match does not carry the scope.
870
+
871
+ ### Extract DESIGN.md in-place from the project's own homepage
872
+
873
+ `maggie_design_system.py generate` builds a DESIGN.md from clone evidence, which
874
+ an in-place redesign does not have. When the design source of truth is the
875
+ project's existing homepage, author `DESIGN.md` directly from it: read the
876
+ `:root` tokens, fonts, composition, responsive and interaction rules from the
877
+ live page, write the eight required headings (`## Source and evidence`,
878
+ `## Design tokens`, `## Composition rules`, `## Responsive rules`,
879
+ `## Interaction rules`, `## Shared shell contract`, `## New page contract`,
880
+ `## Unknowns and approvals`), and include the `Generated by Maggie` marker line
881
+ so `maggie tool maggie_design_system.py validate DESIGN.md` passes. State in
882
+ `## Source and evidence` that it was extracted in-place with no external clone.
883
+ This unlocks `maggie design in-place` for a route without a clone run.
@@ -31,16 +31,22 @@ Follow [Maggie Memory Hook](../../references/memory-hook.md) at invocation and c
31
31
  3. `maggie security doctor --fix` — creates `.maggie/security/config.json` and
32
32
  keeps `.maggie/security/` out of git.
33
33
 
34
+ Then `maggie security scan` runs the right detectors for the detected profile and
35
+ builds a report in one step (add `--domain` for the web checks and
36
+ `--ssh ALIAS=user@host` for the host checks once consent is granted). Use the
37
+ individual commands below when you want one area, or `scan` for the whole sweep.
38
+
34
39
  ## What to run
35
40
 
36
41
  | The user wants… | Run | MCP tool |
37
42
  |---|---|---|
43
+ | "do a full security check" / "scan my site" | `maggie security scan` — detects the profile, runs the right detectors (inventory → vulns, deps, secrets, code, EOL; add `--domain` for headers/tls, `--ssh ALIAS=user@host` for host checks), then builds a report. Add `--fix-plan` for a remediation runbook. Each detector is best-effort. | `security_scan` |
38
44
  | "anything new I should worry about?" | `maggie security vuln-watch` then `maggie security eol-watch` | `security_vuln_watch`, `security_eol_check` |
39
45
  | "are we affected by CVE-X?" | `maggie security osv-query --id CVE-X`; for a runtime/OS: `maggie security advisory --cve CVE-X --component php` → [CVE response](references/cve-response.md) | `security_osv_query`, `security_findings_list` |
40
46
  | "is package X safe?" | `maggie security osv-query --purl pkg:npm/x@1.2.3` | `security_osv_query` |
41
47
  | "is our WordPress / plugin safe?" | `maggie security wp-check` | `security_wp_check` |
42
48
  | "is our PHP / MySQL / Ubuntu / Node still supported?" | `maggie security eol-watch` (`--product php=8.1` without an inventory) | `security_eol_check` |
43
- | "Node.js security releases" | `maggie security node-check` | `security_eol_check` |
49
+ | "Node.js security releases" | `maggie security node-check` | `security_node_check` |
44
50
  | "check before deploy" / CI gate | `maggie security deps --ci`, `maggie security secrets --ci`, then `maggie security report --kind gate --output .maggie/security/gate.json` and `maggie deployment readiness --security-report .maggie/security/gate.json` | `security_deps_scan`, `security_secrets_scan`, `security_report_build` |
45
51
  | "did a key or password leak?" | `maggie security secrets` (git history, project files, build output) | `security_secrets_scan` |
46
52
  | "are my dependencies safe?" | `maggie security deps` (every lockfile ecosystem + JavaScript copied into the site) | `security_deps_scan` |
@@ -50,12 +56,14 @@ Follow [Maggie Memory Hook](../../references/memory-hook.md) at invocation and c
50
56
  | "are we being attacked / were we hacked?" | `maggie security logs-traffic --file access.log`, `maggie security logs-sigma --file access.log`, `maggie security logs-ioc --file access.log`; servers: `maggie security logs-remote --ssh web1=user@host` | `security_logs_check` |
51
57
  | "is my server hardened?" | `maggie security host-quick --ssh web1=user@host` (or `--print-collector` for the person to run), `maggie security host-nginx-config --ssh web1=user@host`, deep: `maggie security host-audit --ssh web1=user@host` | `security_host_check` |
52
58
  | "protect my server" (CrowdSec / fail2ban / Cloudflare) | `maggie security protect-plan --host web1 [--engine crowdsec\|fail2ban]` → the person reviews and runs it under the host lock; afterwards `maggie security protect-plan verify --plan FILE --ssh web1=user@host` | `security_protect_plan` |
53
- | "give me the fixes to run" | after the checks: `maggie security fix-plan --script fix.sh --output RUNBOOK.md` — a reviewed runbook (file permissions, firewall, apt updates, intrusion prevention, nginx, EOL) built from the findings, each action tagged with a fix-risk tier T1–T4 (T1 batch-safe → T3 validate+auto-rollback → T4 stage-first/accepted-risk) so the operator knows what is safe to batch vs what must be tested first; the person reviews it and runs it themselves under the host lock. Maggie never applies it. Run `maggie security host-impact` first so the plan is blast-radius-aware (which services a patch affects, what must restart, whether a reboot is pending). | — |
59
+ | "give me the fixes to run" | after the checks: `maggie security fix-plan --script fix.sh --output RUNBOOK.md` — a reviewed runbook (file permissions, firewall, apt updates, intrusion prevention, nginx, EOL) built from the findings, each action tagged with a fix-risk tier T1–T4 (T1 batch-safe → T3 validate+auto-rollback → T4 stage-first/accepted-risk) so the operator knows what is safe to batch vs what must be tested first; the person reviews it and runs it themselves under the host lock. Maggie never applies it. Run `maggie security host-impact` first so the plan is blast-radius-aware (which services a patch affects, what must restart, whether a reboot is pending). | `security_fix_plan` |
60
+ | "track a CVE response / log an incident" | `maggie security incident start --title … --cve …`, then `incident log --id … --event … --note …`, and `incident close --id …`; read the timeline in `report --kind incident`. Local records only — no server or site is changed. | `security_incident` |
54
61
  | "monitor uptime / tell me when the site is down" | `maggie security uptime-init` (verified domains) → `maggie security uptime-deploy --hostname status.example.com` (plan) → `maggie security uptime-status --gatus URL`; jobs report with `maggie security uptime-push` | `security_uptime_status` |
55
62
  | "how do we compare to OWASP?" / "threat model" | `maggie security checklist --level 1`, `maggie security threat-model --include-findings` | `security_checklist_get`, `security_threat_model` |
56
63
  | "is this npm package safe to add?" | `maggie security preinstall PKG[@VERSION]` before installing (W5); never install on `block` | `security_package_vet` |
57
64
  | "is this skill / MCP server safe to install?" | `maggie security skills-scan PATH` (or `--kind mcp-registry`); `maggie security mcp-self-check` for our own MCP | `security_skills_scan`, `security_mcp_self_check` |
58
65
  | "any malicious package in the project?" / container image / SBOM | `maggie security exposure-check`, `maggie security image REF`, `maggie security sbom` | `security_exposure_check`, `security_image_scan`, `security_sbom_build` |
66
+ | "patch the container image" | `maggie security image-patch REF [--report trivy.json]` — a reviewed copa plan to rebuild the image with its OS-package fixes into a new tag; the operator runs it (needs Docker/buildkit). Maggie never runs copa. | `security_image_patch` |
59
67
  | "what does GitHub say?" | export alerts with github-mcp-server (read-only toolsets) and run `maggie security github-alerts --from-file alerts.json --repo OWNER/NAME` | — |
60
68
  | "security report" | `maggie security report --kind weekly` (`--audience technical` for developers) | `security_report_build` + `report_save` |
61
69
  | "we accept this risk" / "that's a false positive" | `maggie security ledger accept --id … --reason … [--until YYYY-MM-DD]` — only when the person says so | `security_ledger_mark` |
@@ -8,6 +8,12 @@ Exit codes: 0 ok · 1 findings at/above `--fail-on` · 2 usage · 3 degraded
8
8
  (a source or tool did not answer) · 4 refused by policy · 5 scanner missing
9
9
  or checksum mismatch.
10
10
 
11
+ ## Scan (one-shot orchestrator)
12
+
13
+ | Command | What it does |
14
+ |---|---|
15
+ | `maggie security scan [--profile TYPE] [--domain D] [--ssh ALIAS=user@host] [--kind weekly\|daily_ops] [--fix-plan] [--offline]` | Detects the site profile (or `--profile`), runs the detectors that profile expects (inventory → vuln-watch, deps, secrets, code-scan, eol-watch, and wp-check/node-check by profile; adds headers/tls when `--domain` is given and host-quick/host-impact when `--ssh` is given), then builds a report. Each detector runs in its own process, best-effort — one that degrades or refuses does not abort the scan. Interactive/heavy commands (web-scan, zap-baseline, host-audit, public-check, logs-remote) are never auto-run. Exposed over MCP as `security_scan`. |
16
+
11
17
  ## Housekeeping
12
18
 
13
19
  | Command | What it does |
@@ -48,7 +54,7 @@ findings never leave the machine.
48
54
  | Command | What it does | Contacted |
49
55
  |---|---|---|
50
56
  | `maggie security domain-verify start\|check\|status\|revoke --domain D [--method dns\|file]` | proves control of the registrable domain (TXT seen by the system resolver **and** DNS-over-HTTPS) or one host (file); valid 90 days, re-checked weekly | system resolver, cloudflare-dns.com, the site |
51
- | `maggie security headers --url U [--paths / /login] [--serving auto\|nginx\|apache\|cloudflare\|headers-file\|astro\|next\|php]` | grades security headers and cookies per path (ASVS 5.0 ids), plain-HTTP redirect, fix snippets for the serving layer; a new CSP is always suggested as Report-Only first | the site |
57
+ | `maggie security headers --url U [--paths / /login] [--serving auto\|nginx\|apache\|cloudflare\|headers-file\|astro\|next\|php]` | grades security headers and cookies per path (ASVS 5.0 ids), plain-HTTP redirect, fix snippets for the serving layer; a new CSP is always suggested as Report-Only first. Emits a **letter grade A+…F** (an info finding, score 0–100) using the mdn-http-observatory additive model, so owners see "you are a C → here is how to reach a B" | the site |
52
58
  | `maggie security tls --host H [--engine auto\|testssl\|native] [--ip ORIGIN]` | certificate trust and expiry, TLS 1.0/1.1 still accepted, TLS 1.3 missing; testssl.sh (GPL, installed by the person) when present | the site |
53
59
  | `maggie security web-scan --url U [--profile safe\|full-safe]` | httpx fingerprint, then nuclei with the safe profile (no intrusive, fuzz, DoS, brute-force, OAST templates; ≤ 10 req/s; one scan per domain at a time) | the site |
54
60
  | `maggie security zap-baseline --url U` | weekly passive ZAP baseline in Docker; header rules skipped (headers covers them) | the site |
@@ -71,7 +77,7 @@ checks stay verified-only — do not run them against a site you do not control.
71
77
 
72
78
  | Command | What it does |
73
79
  |---|---|
74
- | `maggie security code-scan [--changed-since REF] [--rules maggie\|DIR] [--baseline FILE\|--write-baseline FILE]` | semgrep (LGPL, installed by the person, `--metrics=off`) with Maggie's 22-rule pack for Astro, React/Next, Node, PHP/WordPress, Dockerfile, nginx, plus native checks for root containers and served dotfiles; registry rules are refused |
80
+ | `maggie security code-scan [--changed-since REF] [--rules maggie\|DIR] [--baseline FILE\|--write-baseline FILE]` | semgrep (LGPL, installed by the person, `--metrics=off`) with Maggie's 22-rule pack for Astro, React/Next, Node, PHP/WordPress, Dockerfile, nginx, plus native checks for root containers, served dotfiles, and **personal data written to logs** (GDPR / CWE-532, a privacy rule reimplemented from Bearer's patterns since Bearer itself is Elastic-licensed and cannot be run); registry rules are refused |
75
81
 
76
82
  ## Logs (read where they are; never uploaded)
77
83
 
@@ -92,7 +98,6 @@ Formats: nginx/Apache combined and vcombined, Caddy JSON, Cloudflare Logpush JSO
92
98
  | `maggie security host-nginx-config --ssh web1=user@host \| --evidence FILE` | nginx -T and php -i rules: hidden files, PHP in uploads, PATH_INFO, old TLS/weak ciphers, HSTS, add_header inheritance, WordPress login limits, xmlrpc, key permissions | ssh-read |
93
99
  | `maggie security host-audit --ssh web1=user@host \| --evidence report.dat` | lynis (GPL, external) uploaded to a private /tmp folder under the host lock, removed afterwards (verified); hardening index and warnings | ssh-temp-write |
94
100
  | `maggie security host-impact --ssh web1=user@host \| --evidence FILE \| --print-collector` | patch **blast radius** (read-only): which pending updates are security-only (`apt-get -s upgrade` origin parsing) vs not, which running services still use pre-update libraries and must restart (`needrestart -b` — a patched library in memory is still the old one until restart), whether a reboot is pending (`/var/run/reboot-required` + kernel comparison), and the port→process map. Writes `inventory/impact.json`, which `fix-plan` reads to sharpen its risk tiers and restart steps. Techniques ported from PatchMon (MIT). | ssh-read |
95
- | `maggie security incident start\|log\|close\|show\|list` | timeline for a CVE response; `report --kind incident` prints it | none |
96
101
 
97
102
  ## Protect and assure
98
103
 
@@ -105,6 +110,7 @@ Formats: nginx/Apache combined and vcombined, Caddy JSON, Cloudflare Logpush JSO
105
110
  | `maggie security waf-replay --log access.log [--paranoia 2] [--threshold 5] [--exclude-bots]` | replays the log through Coraza + OWASP CRS v4 offline (helper `maggie-waf-replay`); share of real visitors each paranoia level would block, rules needing exclusions; feeds `protect-plan --replay-report` |
106
111
  | `maggie security sbom [--engine native\|syft] [--image REF]` | CycloneDX 1.5 SBOM |
107
112
  | `maggie security image REF` | trivy (vulns, secrets without values, misconfig, EOL base) + dockle |
113
+ | `maggie security image-patch REF [--report trivy.json] [--tag OUT] [--pkg-types os\|os,library] [--script FILE]` | a reviewed **copa** plan to rebuild the image with its OS-package security fixes applied, into a **new tag** (the original image is untouched). Completes the safe-patching story for containers. Plan only — Maggie never runs copa; the operator runs it where Docker/buildkit is available. Exposed over MCP as `security_image_patch`. |
108
114
  | `maggie security preinstall PKG[@V] [--threshold strict]` | npm package vetting: age, version age, install scripts, typosquats, OSV MAL-/vulns, Scorecard; never installs |
109
115
  | `maggie security exposure-check [--root DIR] [--deep] [--catalog-dir DIR]` | malicious packages already installed (OSV MAL- and incident catalogs) |
110
116
  | `maggie security skills-scan PATH [--kind mcp-registry] [--max-risk 50]` | SkillSpector (installed by you, `--no-llm` forced) |
@@ -124,4 +130,5 @@ Formats: nginx/Apache combined and vcombined, Caddy JSON, Cloudflare Logpush JSO
124
130
  |---|---|
125
131
  | `maggie security report --kind weekly\|daily_ops\|incident\|gate [--audience owner\|technical] [--save]` | Markdown + JSON report from the latest runs; `--save` writes the `report_save` payload |
126
132
  | `maggie security fix-plan [--priority p0..p4] [--script fix.sh] [--output RUNBOOK.md]` | a reviewed remediation runbook from the open findings: grouped by category (file permissions, firewall, package/apt updates, intrusion prevention, web-server config, EOL), each step the commands the findings themselves carry (never invented). Every action is tagged with a **fix-risk tier** (T1 batch-safe distro/permission fixes → T2 restart+smoke-test → T3 config hardening that validates and auto-rolls-back → T4 major/EOL moves that are NOT auto-applied and are emitted as accepted-risk drafts to stage first); the apt batch backs up package state and verifies afterwards. If `host-impact` has run, the plan also shows the **blast radius** (which services each patch affects, what must restart, whether a reboot is pending) and its apt verify step restarts the services still running pre-update libraries. Writes a shell script you run yourself, under `maggie deployment host-lock`, after a backup and with a second SSH session open. Maggie never applies it. |
133
+ | `maggie security incident start\|log\|close\|show\|list` | timeline for a CVE response or other incident (local records only); `report --kind incident` prints the timeline. Exposed over MCP as `security_incident` (write actions need the preview→confirm handshake). |
127
134
  | `maggie security mcp [--tools p0\|all] [--print-config claude\|codex]` | local stdio MCP server |
@@ -6,6 +6,13 @@ Four parts, plain words, one action per finding:
6
6
 
7
7
  Urgency words: p0 today · p1 this week · p2 this month · p3 when convenient · p4 for information.
8
8
  No CVSS vectors, purls or rule ids for site owners; keep them for developers.
9
+
10
+ The technical report also shows an **SSVC decision** per action — a defensible
11
+ "do it now vs watch it" call from the signals we already have (CISA SSVC, a
12
+ simplification of the deployer tree): **Act** (actively exploited — KEV — with high
13
+ impact), **Attend** (automatable — high EPSS — and high impact), **Track\*** (high
14
+ impact but no exploitation yet) or **Track** (routine). It is a rationale, not a new
15
+ severity; owners still see the plain urgency words above.
9
16
  Name components the way the owner sees them (the plugin's name in WordPress,
10
17
  "your database (MySQL 5.7)", "the server's operating system (Ubuntu 20.04)").
11
18
 
@@ -13,4 +13,12 @@ required ones (for example nuclei `-ni -duc`).
13
13
  | external-only | GPL, LGPL | installed by the person from upstream; called as a separate process |
14
14
  | reference-only | AGPL, BSL, ELv2 | design reference; not run by Maggie |
15
15
 
16
+ Ported methods (data/algorithm, not bundled code):
17
+ - The HTTP security-header **letter grade** in `maggie security headers` uses the
18
+ additive score model and grade chart from
19
+ [mdn-http-observatory](https://github.com/mdn/mdn-http-observatory) (MPL-2.0),
20
+ reimplemented as a Python data table.
21
+ - Patch **blast-radius** and **fix-risk** handling in `host-impact`/`fix-plan`
22
+ follow [PatchMon](https://github.com/PatchMon/PatchMon) (MIT) techniques.
23
+
16
24
  Packaged data and its attribution: [data/LICENSE-NOTICE.md](../data/LICENSE-NOTICE.md).