tadforce 0.0.0-stage → 0.2.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 (142) hide show
  1. package/.claude-plugin/marketplace.json +20 -0
  2. package/.claude-plugin/plugin.json +13 -0
  3. package/LICENSE +202 -0
  4. package/NOTICE +11 -0
  5. package/README.fr.md +125 -0
  6. package/README.md +256 -2
  7. package/assets/logo-mark.svg +24 -0
  8. package/assets/logo.svg +31 -0
  9. package/bin/tadforce.js +4 -0
  10. package/commands/tadforce-review.md +8 -0
  11. package/commands/tadforce-update.md +6 -0
  12. package/commands/tadforce.md +10 -0
  13. package/package.json +60 -4
  14. package/skills/tadforce/SKILL.md +73 -0
  15. package/skills/tadforce/references/axes-rules.md +29 -0
  16. package/skills/tadforce/references/evidence-rules.md +40 -0
  17. package/skills/tadforce/references/exclusion-heuristics.md +40 -0
  18. package/skills/tadforce/references/figure-rules.md +42 -0
  19. package/skills/tadforce/references/markdown-conventions.md +67 -0
  20. package/skills/tadforce/references/modules/agentforce-ai.md +24 -0
  21. package/skills/tadforce/references/modules/analytics.md +19 -0
  22. package/skills/tadforce/references/modules/commerce.md +25 -0
  23. package/skills/tadforce/references/modules/data-cloud.md +23 -0
  24. package/skills/tadforce/references/modules/experience-cloud.md +24 -0
  25. package/skills/tadforce/references/modules/field-service.md +25 -0
  26. package/skills/tadforce/references/modules/industries.md +21 -0
  27. package/skills/tadforce/references/modules/integration-platforms.md +19 -0
  28. package/skills/tadforce/references/modules/marketing.md +24 -0
  29. package/skills/tadforce/references/modules/omnistudio.md +24 -0
  30. package/skills/tadforce/references/modules/platform-events.md +19 -0
  31. package/skills/tadforce/references/modules/revenue-cpq.md +25 -0
  32. package/skills/tadforce/references/modules/sales-cloud.md +26 -0
  33. package/skills/tadforce/references/modules/security-shield.md +18 -0
  34. package/skills/tadforce/references/modules/service-cloud.md +27 -0
  35. package/skills/tadforce/references/naming-external-systems.md +32 -0
  36. package/skills/tadforce/references/questions.md +59 -0
  37. package/skills/tadforce/references/salesforce-skills.md +27 -0
  38. package/skills/tadforce/references/workflow.md +85 -0
  39. package/skills/tadforce/references/writing-rules.md +47 -0
  40. package/skills/tadforce-review/SKILL.md +53 -0
  41. package/skills/tadforce-update/SKILL.md +48 -0
  42. package/src/build/brand.js +107 -0
  43. package/src/build/browser.js +70 -0
  44. package/src/build/directives.js +293 -0
  45. package/src/build/export.js +60 -0
  46. package/src/build/figures.js +119 -0
  47. package/src/build/mermaid.js +107 -0
  48. package/src/build/render.js +299 -0
  49. package/src/build/serve.js +59 -0
  50. package/src/cli.js +68 -0
  51. package/src/commands/docs.js +191 -0
  52. package/src/commands/doctor.js +366 -0
  53. package/src/commands/init.js +132 -0
  54. package/src/commands/org.js +151 -0
  55. package/src/commands/review.js +35 -0
  56. package/src/commands/spec.js +91 -0
  57. package/src/commands/update.js +153 -0
  58. package/src/facts/extractors/apex.js +111 -0
  59. package/src/facts/extractors/automation.js +85 -0
  60. package/src/facts/extractors/data.js +94 -0
  61. package/src/facts/extractors/integration.js +76 -0
  62. package/src/facts/extractors/misc.js +100 -0
  63. package/src/facts/extractors/security.js +92 -0
  64. package/src/facts/extractors/ui.js +120 -0
  65. package/src/facts/fingerprints.js +32 -0
  66. package/src/facts/heuristics/exclusions.js +143 -0
  67. package/src/facts/heuristics/modules.js +85 -0
  68. package/src/facts/heuristics/naming.js +31 -0
  69. package/src/facts/heuristics/signals.js +76 -0
  70. package/src/facts/index.js +197 -0
  71. package/src/facts/org.js +87 -0
  72. package/src/facts/xml.js +85 -0
  73. package/src/sf/sf.js +120 -0
  74. package/src/util/args.js +21 -0
  75. package/src/util/config.js +104 -0
  76. package/src/util/fsx.js +58 -0
  77. package/src/util/i18n.js +33 -0
  78. package/src/util/log.js +31 -0
  79. package/src/util/paths.js +11 -0
  80. package/src/validate/index.js +126 -0
  81. package/templates/axes/en/00-document-control.md +3 -0
  82. package/templates/axes/en/01-summary.md +7 -0
  83. package/templates/axes/en/02-method.md +9 -0
  84. package/templates/axes/en/03-findings.md +19 -0
  85. package/templates/axes/en/04-register.md +3 -0
  86. package/templates/axes/en/05-roadmap.md +3 -0
  87. package/templates/axes/en/99-appendix.md +5 -0
  88. package/templates/axes/fr/00-document-control.md +3 -0
  89. package/templates/axes/fr/01-summary.md +7 -0
  90. package/templates/axes/fr/02-method.md +9 -0
  91. package/templates/axes/fr/03-findings.md +19 -0
  92. package/templates/axes/fr/04-register.md +3 -0
  93. package/templates/axes/fr/05-roadmap.md +3 -0
  94. package/templates/axes/fr/99-appendix.md +5 -0
  95. package/templates/html/cover.html +12 -0
  96. package/templates/html/editor.js +502 -0
  97. package/templates/html/style.css +255 -0
  98. package/templates/html/template.html +88 -0
  99. package/templates/i18n/en.json +366 -0
  100. package/templates/i18n/fr.json +366 -0
  101. package/templates/manifest/package-tad.xml +543 -0
  102. package/templates/specs/sections.yml +494 -0
  103. package/templates/tad/en/00-document-control.md +7 -0
  104. package/templates/tad/en/01-summary.md +17 -0
  105. package/templates/tad/en/02-purpose.md +35 -0
  106. package/templates/tad/en/03-context.md +17 -0
  107. package/templates/tad/en/04-general.md +29 -0
  108. package/templates/tad/en/05-functional.md +7 -0
  109. package/templates/tad/en/06-data.md +71 -0
  110. package/templates/tad/en/07-application.md +49 -0
  111. package/templates/tad/en/08-ui.md +41 -0
  112. package/templates/tad/en/09-integrations.md +53 -0
  113. package/templates/tad/en/10-security.md +59 -0
  114. package/templates/tad/en/11-reporting.md +13 -0
  115. package/templates/tad/en/12-operations.md +25 -0
  116. package/templates/tad/en/13-nfr.md +9 -0
  117. package/templates/tad/en/14-decisions.md +3 -0
  118. package/templates/tad/en/15-outlook.md +3 -0
  119. package/templates/tad/en/99-appendices.md +119 -0
  120. package/templates/tad/fr/00-document-control.md +7 -0
  121. package/templates/tad/fr/01-summary.md +17 -0
  122. package/templates/tad/fr/02-purpose.md +35 -0
  123. package/templates/tad/fr/03-context.md +17 -0
  124. package/templates/tad/fr/04-general.md +29 -0
  125. package/templates/tad/fr/05-functional.md +7 -0
  126. package/templates/tad/fr/06-data.md +71 -0
  127. package/templates/tad/fr/07-application.md +49 -0
  128. package/templates/tad/fr/08-ui.md +41 -0
  129. package/templates/tad/fr/09-integrations.md +53 -0
  130. package/templates/tad/fr/10-security.md +59 -0
  131. package/templates/tad/fr/11-reporting.md +13 -0
  132. package/templates/tad/fr/12-operations.md +25 -0
  133. package/templates/tad/fr/13-nfr.md +9 -0
  134. package/templates/tad/fr/14-decisions.md +3 -0
  135. package/templates/tad/fr/15-outlook.md +3 -0
  136. package/templates/tad/fr/99-appendices.md +119 -0
  137. package/templates/vendor/LICENSE-html-docx-js.txt +21 -0
  138. package/templates/vendor/LICENSE-html2canvas.txt +22 -0
  139. package/templates/vendor/LICENSE-mermaid.txt +21 -0
  140. package/templates/vendor/html-docx.js +13216 -0
  141. package/templates/vendor/html2canvas.min.js +20 -0
  142. package/templates/vendor/mermaid.min.js +2314 -0
@@ -0,0 +1,19 @@
1
+ # Integration platforms and connected services (MuleSoft, Heroku, Slack, external services, Salesforce Connect)
2
+
3
+ **Detected by** named credentials and hosts (`*.cloudhub.io`, `*.anypoint.mulesoft.com`, `*.herokuapp.com`, `*.slack.com`), `externalServiceRegistrations`, external objects (`__x`) and `dataSources`, Slack metadata or namespaces.
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 9 Integrations | The middleware as a system of its own (named in the glossary: « API Gateway », « MuleSoft »), the APIs consumed through it, External Services (OpenAPI-based actions used by flows and agents), Salesforce Connect external objects (data virtualization), Slack integrations (notifications, Slack apps) |
10
+ | 4 General | Position of the middleware in the context view |
11
+ | 10 Security | Credentials (named / external credentials, principals, per-user vs named principal), integration users, mutual TLS certificates (names only) |
12
+
13
+ ## Read
14
+
15
+ `namedCredentials`, `externalCredentials`, `externalServiceRegistrations`, `dataSources`, external objects, Apex classes with `callout:`, Integration Procedures with HTTP actions.
16
+
17
+ ## Watch out
18
+
19
+ What happens behind the middleware is out of scope unless documented: say « exposed by the API Gateway » rather than guessing the system behind it.
@@ -0,0 +1,24 @@
1
+ # Marketing (Marketing Cloud Connect, Account Engagement, Marketing Cloud on the core platform)
2
+
3
+ **Detected by** namespaces `et4ae5` (Marketing Cloud Connect) or `pi` (Account Engagement / Pardot); Marketing Cloud Growth/Advanced on core shows standard marketing objects and Data Cloud.
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 5 Functional | Campaign process: audiences, journeys or engagement programs, sends, tracking back to the CRM, lead scoring and grading, hand-over to sales |
10
+ | 6 Data | `Campaign`, `CampaignMember`, consent objects (`Individual`, `ContactPointTypeConsent`, communication subscriptions), tracking objects of the connector |
11
+ | 9 Integrations | Connector configuration (synchronised objects, triggered sends, business units), direction and frequency, connector user |
12
+ | 10 Security | Connector user and permission sets, consent and unsubscribe handling |
13
+
14
+ ## Read
15
+
16
+ `et4ae5__*` / `pi__*` references, `objects/Campaign`, `objects/CampaignMember`, consent objects, connector permission sets, triggered-send configurations.
17
+
18
+ ## Draw
19
+
20
+ Sequence CRM → marketing platform → tracking back; flowchart of the lead hand-over.
21
+
22
+ ## Watch out
23
+
24
+ The internal configuration of Marketing Cloud (journeys, content, data extensions) is out of the org: put it out of scope unless documents are provided. Never reproduce audiences or personal data.
@@ -0,0 +1,24 @@
1
+ # OmniStudio
2
+
3
+ **Detected by** `omniScripts`, `omniIntegrationProcedures`, `omniDataTransforms`, `omniUiCard`, or namespaces `omnistudio` / `vlocity_*`.
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 7 Application | Role split: OmniScripts (guided journeys), Integration Procedures (server-side orchestration, caching), Data Mappers (extract, load, transform), FlexCards (display); naming (`Type/SubType/Language`); one table per family (generated appendix lists the active versions) |
10
+ | 5 Functional | The journeys implemented as OmniScripts, step by step for the main ones |
11
+ | 9 Integrations | HTTP actions and Remote Actions (Apex) called by Integration Procedures |
12
+ | 12 Operations | Deployment of OmniStudio assets (separate step, activation of versions), runtime (standard vs managed package) |
13
+
14
+ ## Read
15
+
16
+ The `type`, `subType`, `language`, `isActive` of each asset; inside the JSON: elements of type `Integration Procedure Action`, `DataRaptor …`, `Remote Action` (Apex class and method), `HTTP Action` (named credential), custom LWC elements (`lwcName`).
17
+
18
+ ## Draw
19
+
20
+ Flowchart OmniScript → Integration Procedure → Data Mapper / Apex / HTTP for each main journey.
21
+
22
+ ## Watch out
23
+
24
+ Only active versions are documented; several versions of the same asset are normal. Standard runtime (on-platform) vs managed package runtime changes deployment and naming: say which.
@@ -0,0 +1,19 @@
1
+ # Platform Events and Change Data Capture
2
+
3
+ **Detected by** objects ending with `__e`, `platformEventChannels`, `platformEventChannelMembers` (CDC entities), event-triggered flows and triggers.
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 6 Data | `data.events`: each event (purpose, fields in one line), CDC entities selected |
10
+ | 7 Application | Publishers (Apex `EventBus.publish`, flows, processes) and subscribers (triggers on `__e`, platform-event-triggered flows, external subscribers via Pub/Sub API or CometD) |
11
+ | 9 Integrations | External subscribers and publishers, replay and retention, ordering assumptions |
12
+
13
+ ## Draw
14
+
15
+ Sequence publisher → event bus → subscribers (internal and external).
16
+
17
+ ## Watch out
18
+
19
+ Publish behaviour (`Publish Immediately` vs `Publish After Commit`) matters for consistency: read the event definition. High-volume events have allocations: mention them as facts.
@@ -0,0 +1,25 @@
1
+ # Quote-to-cash: Salesforce CPQ, Billing, Revenue Cloud
2
+
3
+ **Detected by** namespaces `SBQQ` (CPQ), `blng` (Billing), `sbaa` (Advanced Approvals); Revenue Cloud by `ProductSellingModel`, `BillingSchedule`, `Invoice`.
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 5 Functional | Quote-to-cash: configure (bundles, options, rules), price (price rules, discount schedules, contracted prices), quote and approve, contract, order, amend and renew, invoice and collect |
10
+ | 6 Data | Product and bundle model, price books, quote / quote line, contract, subscription, order, invoice |
11
+ | 7 Application | Price and product rules (records, not metadata: ask), quote calculator plugins (Apex/JS), approval chains, custom triggers on package objects |
12
+ | 9 Integrations | ERP, e-signature, payment and tax |
13
+ | 10 Security | Package licences and permission sets, approval delegations |
14
+
15
+ ## Read
16
+
17
+ `SBQQ__*` / `blng__*` fields on local objects, custom fields on package objects, Apex implementing `SBQQ.QuoteCalculatorPlugin*`, approval processes, flows on orders and contracts.
18
+
19
+ ## Draw
20
+
21
+ Flowchart quote → contract → order → invoice; state diagram of the quote status.
22
+
23
+ ## Watch out
24
+
25
+ Most CPQ configuration lives in records (price rules, product rules, templates): ask for an export or describe it as configuration to confirm. Do not document package internals.
@@ -0,0 +1,26 @@
1
+ # Sales Cloud
2
+
3
+ **Detected by** customised `Lead`, `Opportunity`, `Quote`, `OpportunityLineItem`, forecasting types, territory models, Sales Engagement cadences.
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 5 Functional | Lead lifecycle (sources, qualification, assignment, conversion, recycling); opportunity pipeline (stages, sales processes per record type, products and price books, quotes); forecasting; territories; activities and cadences |
10
+ | 6 Data | `Lead` → `Account`/`Contact`/`Opportunity` conversion mapping (custom field mapping), opportunity record types and sales processes, path guidance |
11
+ | 7 Application | Assignment rules, lead / opportunity triggers and flows, duplicate and matching rules |
12
+ | 8 UI | Path (`pathAssistants`), Kanban, record pages, Sales console, mobile |
13
+ | 10 Security | Opportunity and Lead OWD, territory-based sharing, opportunity teams, account teams |
14
+ | 11 Reporting | Pipeline and forecast dashboards |
15
+
16
+ ## Read
17
+
18
+ `objects/Lead`, `objects/Opportunity` (stage picklist, `businessProcesses`, `recordTypes`), `assignmentRules`, `duplicateRules`, `matchingRules`, `pathAssistants`, `forecastingTypes`, `territory2Models`, `quickActions`, lead conversion settings (`settings/Lead.settings-meta.xml`).
19
+
20
+ ## Draw
21
+
22
+ State diagram of lead statuses and opportunity stages; sequence for web-to-lead or API lead creation → assignment.
23
+
24
+ ## Watch out
25
+
26
+ Converted leads are read-only (validation rules often enforce it); lead conversion field mapping is in settings, not in fields; forecast categories derive from stages.
@@ -0,0 +1,18 @@
1
+ # Shield and compliance
2
+
3
+ **Detected by** platform encryption settings, transaction security policies, event monitoring subscriptions, field history retention policies, data masking configuration (sandboxes).
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 10 Security | `security.shield`: encrypted fields and the encryption scheme (probabilistic, deterministic), key management (tenant secrets, BYOK — never the keys), transaction security policies and their actions, event monitoring usage (login forensics, API usage), field audit trail retention |
10
+ | 12 Operations | Who monitors what, retention and export of event logs |
11
+
12
+ ## Read
13
+
14
+ `settings/PlatformEncryption*`, `transactionSecurityPolicies`, `settings/EventSettings*`, objects with `historyRetentionPolicy`, encrypted field metadata (`encryptionScheme`).
15
+
16
+ ## Watch out
17
+
18
+ Never reproduce keys, secrets or certificates. Encryption affects search, formulas and filters: state the constraints observed, put the risks in the Improvement Axes.
@@ -0,0 +1,27 @@
1
+ # Service Cloud
2
+
3
+ **Detected by** customised `Case`, entitlements and milestones, Omni-Channel (service channels, routing configurations, presence), messaging and chat sessions, voice calls, knowledge articles (`*__kav`).
4
+
5
+ ## Document
6
+
7
+ | Chapter | What |
8
+ |---|---|
9
+ | 5 Functional | Case lifecycle: channels in (e-mail-to-case, web-to-case, messaging, voice, portal, API), triage, assignment and escalation, SLA (entitlements, milestones), resolution, closure, surveys; knowledge usage |
10
+ | 6 Data | `Case` record types and support processes, `Entitlement`, `ServiceContract`, `CaseMilestone`, knowledge article types and data categories |
11
+ | 7 Application | Assignment, auto-response and escalation rules; case triggers and flows; macros and quick text |
12
+ | 8 UI | Service console, utility bar (softphone, omni widget, history), case record pages; telephony (Service Cloud Voice or CTI adapter via `callCenters`) and Omni-Channel (channels, queues, skills, capacity, presence statuses) |
13
+ | 9 Integrations | Telephony provider, messaging providers (WhatsApp, SMS), e-mail routing addresses |
14
+ | 10 Security | Case sharing, queue membership, support profiles and permission set groups, Experience Cloud case access |
15
+ | 11 Reporting | Service KPIs (backlog, first contact resolution, SLA attainment) |
16
+
17
+ ## Read
18
+
19
+ `objects/Case`, `entitlementProcesses`, `milestoneTypes`, `assignmentRules/Case`, `autoResponseRules`, `escalationRules`, `serviceChannels`, `queueRoutingConfigs`, `presenceUserConfigs`, `servicePresenceStatuses`, `callCenters`, `queues`, `settings/Case.settings-meta.xml`, `settings/EmailToCase*`, `quickActions`, messaging channels.
20
+
21
+ ## Draw
22
+
23
+ Flowchart of case channels → routing → queues → agents; state diagram of case statuses; sequence of an inbound call or message with Omni-Channel.
24
+
25
+ ## Watch out
26
+
27
+ Routing may be queue-based or skills-based (attribute routing): say which. Omni-Channel capacity and presence are configuration, not code. Do not reproduce e-mail addresses or phone numbers.
@@ -0,0 +1,32 @@
1
+ # Naming external systems and imposing the client's terms
2
+
3
+ A wrong system name in a client document is the fastest way to lose the reader's trust. It happens when a name is inferred from a field (`LegacyCoreId__c`), a class (`CoreBankingClient`) or a host (`api-int-07.example`). TADForce forbids it.
4
+
5
+ ## Where systems come from
6
+
7
+ `tadforce facts` groups the endpoints seen from Salesforce — named credentials, external credentials, remote sites, CSP trusted sites, auth providers, connected apps, call centers — and matches them with `knowledge/glossary.yml › systems`. Unmatched endpoints land in `facts/questions.json › systems`.
8
+
9
+ ```yaml
10
+ systems:
11
+ - id: core
12
+ name: "Core banking" # exactly as the client says it
13
+ description: "System of record for accounts and contracts"
14
+ match: ["Core_API", "api.core.example.com"] # component names or hosts (sub-domains match)
15
+ actors:
16
+ - name: "Branch advisors"
17
+ channel: "Branch console"
18
+ terms:
19
+ - use: "API Gateway"
20
+ avoid: ["API passerelle", "middleware"]
21
+ definition: "Single entry point exposing the internal services." # goes to the glossary appendix
22
+ allow: [customerId, offerCode] # identifiers quoted on purpose that are not metadata (API payload fields…)
23
+ ```
24
+
25
+ ## Rules
26
+
27
+ 1. Ask, with the evidence: host, named credential, the classes or Integration Procedures that call it.
28
+ 2. Propose a name only when the host is unambiguous about a vendor (`*.twilio.com` → Twilio).
29
+ 3. Data teams, middleware and gateways are systems too: name them as the client does (« DATA », « API Gateway »).
30
+ 4. Inbound callers (connected apps, Apex REST) are systems as well: who calls `/leads/v1/*`?
31
+ 5. Once named, use the name everywhere — text, tables, sequence participants, flowchart nodes.
32
+ 6. Terms with `avoid` are checked by `tadforce validate` (whole words, case-insensitive).
@@ -0,0 +1,59 @@
1
+ # Questions — what only a human can answer
2
+
3
+ Ask in **blocks**, each in one message, with your proposed answer for every item so the human only confirms or corrects. Write the question in the human's language.
4
+
5
+ ## Block A — startup (before or right after authorization)
6
+
7
+ `npx tadforce doctor --json` returns these questions with a `recommended` answer each (from the org when connected). Ask them all in one message:
8
+
9
+ 1. Document language — recommended: the org default language.
10
+ 2. Client name and short code (file names) — recommended: `Organization.Name` / `<CODE>`.
11
+ 3. Integrator — **optional**. Blank: the document names the client only (no empty « Integrator » line, no badge).
12
+ 4. Author — **optional**. Blank: no author is shown anywhere. Never put your own name or the agent's.
13
+ 5. Document title — recommended: « Salesforce CRM Platform » (or the client's name for the solution).
14
+ 6. Scope — **optional**: name patterns of the components the project owns (`NWB_*,Loan*`), when the org is shared with other teams. Blank: the whole org.
15
+ 7. Client logo — **optional**: a file or a URL. Blank: TADForce searches the org (static resources, content assets, site assets), then falls back to an initials badge. The document colours follow the org's Lightning theme, else the logo. If none is found and the client has a public website, you may *offer* to look for the logo there — fetch it only after the human says yes.
16
+ 8. Functional specifications — **optional**: paths to PDF / DOCX / MD files (copied into `knowledge/inputs/specs/`).
17
+ 9. Metadata — `org` (recommended: retrieve everything from the org), `local` (the sources of this project), or `both`.
18
+
19
+ Answer with `npx tadforce doctor --json --confirm --lang fr --client "…" --short ABC --integrator none --author "…" --title "…" [--scope "…"] [--logo …] [--specs … | --no-specs] [--source org]`.
20
+
21
+ FR example:
22
+
23
+ > Pour démarrer, je propose : langue **français** (langue par défaut de l'org : fr_FR) · client **« Banque Exemple »** (code `BEX`) · intégrateur : **aucun** · auteur : **aucun** · titre **« Plateforme CRM Salesforce »** · périmètre : **toute l'org** · logo : **cherché dans l'org** · spécifications fonctionnelles : **aucune** · métadonnées : **depuis l'org**. Je confirme ? Indiquez seulement ce qui change.
24
+
25
+ ## Block B — external systems (from `facts/questions.json › systems`)
26
+
27
+ One line per endpoint group: « `api.example.com` (named credential `X_API`, used by `ClassA`, `ClassB`) — which system is it, and how does the client call it? »
28
+
29
+ Rules: never propose a product name you inferred from a field or class name; you may propose the host's organisation when it is explicit (`*.salesforce.com`, `*.twilio.com`, `*.docusign.net`).
30
+
31
+ Write:
32
+
33
+ ```yaml
34
+ systems:
35
+ - id: core
36
+ name: "Core banking"
37
+ description: "System of record for accounts and contracts"
38
+ match: ["X_API", "api.example.com"]
39
+ ```
40
+
41
+ ## Block C — candidates for exclusion (from `facts/questions.json › exclusions.groups`)
42
+
43
+ Present each group with its count and up to 10 names; ask for a decision per group, with exceptions:
44
+
45
+ > 14 components look unused (not placed on any page, app, tab or action): `lwcA`, `lwcB`, … Exclude them from the document? (yes / no / all except …)
46
+
47
+ Write only the confirmed ones in `exclusions.yml › exclude` with the reason given by the human.
48
+
49
+ ## Block D — knowledge only people have
50
+
51
+ 1. Features that were **decommissioned** but whose components are still deployed? (names, components, keywords to ban)
52
+ 2. Terms the client imposes (« API Gateway » rather than « middleware »…)?
53
+ 3. Documents to use as inputs (specifications, previous architecture document, release procedure)? → `knowledge/inputs/`
54
+ 4. Environments (sandboxes and their purpose) and the release process, if not visible in the project.
55
+ 5. User populations (names the client uses) → `glossary.yml › actors`.
56
+
57
+ ## During writing
58
+
59
+ Ask only when a section cannot be written without it, and batch these questions every few sections. Otherwise write the fact you have and mark the rest « to be confirmed » (FR « à confirmer »).
@@ -0,0 +1,27 @@
1
+ # Salesforce skills worth calling
2
+
3
+ Salesforce publishes official agent skills (`forcedotcom/sf-skills`). Install only those you need, for the agents you use:
4
+
5
+ ```bash
6
+ npx skills add forcedotcom/sf-skills --skill platform-architecture-analyze --skill dx-code-analyzer-run --skill platform-metadata-retrieve --skill platform-soql-query --skill platform-docs-get --skill external-diagram-mermaid-generate
7
+ ```
8
+
9
+ Never install all of them for every agent: dozens of folders, hundreds of copies, slower agents.
10
+
11
+ | Skill | Use in TADForce | When |
12
+ |---|---|---|
13
+ | `platform-architecture-analyze` | Well-Architected reading of code and metadata | Chapter 13 and the Improvement Axes |
14
+ | `dx-code-analyzer-run` | Code Analyzer (PMD, ESLint, Flow, ApexGuru…) | Save JSON as `knowledge/inputs/code-analyzer-results.json` |
15
+ | `dx-org-analyze` | Org inventory: licenses, limits, packages | Cross-check `facts/org.json` |
16
+ | `platform-metadata-retrieve` | Retrieve help, partial retrieves | When a type failed in `tadforce retrieve` |
17
+ | `platform-manifest-generate` | Manifest edge cases | Custom manifests |
18
+ | `platform-soql-query` | Aggregated queries (never record data in the document) | Volumes or usage not in org facts |
19
+ | `platform-docs-get` | Official Salesforce documentation | References chapter, product behaviour |
20
+ | `platform-data-and-tooling-api-context-get` | Standard object and field reference | Understanding standard / industry objects |
21
+ | `external-diagram-mermaid-generate` | Mermaid diagrams for Salesforce | Complex sequences |
22
+ | `omnistudio-dependencies-analyze` | OmniScript / IP / Data Mapper dependencies | OmniStudio detected |
23
+ | `agentforce-architecture-analyze` | Agent topics, actions, prompts | Agentforce detected |
24
+ | `data360-schema-get` | Data Cloud schema | Data Cloud detected |
25
+ | `crm-analytics-wave-generate` (read-only use) | CRM Analytics assets | CRM Analytics detected |
26
+
27
+ Rules: use them **read-only**. Skills that deploy, generate metadata or change the org are out of scope for documentation.
@@ -0,0 +1,85 @@
1
+ # Workflow — from an empty folder to a validated document
2
+
3
+ Four commands: **doctor → build → review → update**. Run them from the root of the Salesforce DX project (the folder that holds, or will hold, `sfdx-project.json`). As an agent, always use `--json` and decide from the output.
4
+
5
+ ## 1. `doctor` — everything before the writing
6
+
7
+ ```bash
8
+ npx tadforce doctor --json
9
+ ```
10
+
11
+ `doctor` is a loop: run it, act on its answer, run it again until `ok: true`. Each answer holds `checks[]` (each with `level`, `fix`, `human`), `questions[]` (each with a `recommended` answer) and `next`.
12
+
13
+ | `next` says | You do |
14
+ |---|---|
15
+ | install the missing tools | `sf-cli` missing: you may run `npm install --global @salesforce/cli` after asking. Node or a browser missing: human action (or `npx @puppeteer/browsers install chrome-headless-shell@stable` + `TADFORCE_CHROME`) |
16
+ | the human logs in | No org, or an expired session. Ask the human to run `npx tadforce doctor` in a terminal (it opens the browser) or `sf org login web --alias <a> --set-default [--instance-url https://test.salesforce.com]`. No org at all: `--source local` documents the local sources |
17
+ | ask the human these questions | Block A of `questions.md`: one message, a recommendation for each. Then `npx tadforce doctor --json --confirm --lang fr --client "…" --short ABC --integrator "…"\|none --author "…"\|none --title "…" [--scope "NWB_*,Loan*"] [--logo <file\|url>] [--specs a.pdf,b.docx \| --no-specs] [--source org\|local\|both]` |
18
+ | write the answers to the knowledge files | Blocks B, C and D of `questions.md` → `knowledge/glossary.yml`, `knowledge/exclusions.yml`; then `npx tadforce facts` and `npx tadforce doctor --json --facts-reviewed` |
19
+ | `tadforce build` | Ready: write and build |
20
+
21
+ What `doctor` does by itself, read-only:
22
+
23
+ - creates the SFDX project and the `tadforce/` workspace if missing, installs the skills for the agents found;
24
+ - reuses the project's `target-org` (`sf config get target-org`) — no separate login step when the project already has one;
25
+ - metadata, as chosen (`source`): **org** (recommended — the org is the truth) retrieves every useful type with a `*` manifest into `tadforce/.snapshot` (`force-app` is never touched; large orgs take several minutes: tell the human); **local** reads the package directories; **both** combines them. Then `facts/facts.json`, `facts/org.json` (aggregates), `facts/questions.json`, the chapter skeletons in `tadforce/src/`;
26
+ - branding from evidence: the client logo searched in the snapshot (static resources, content assets, site assets named *logo*), the colours from the org's Lightning theme (`BrandingSet`), else from the logo. Never fetch a logo from the web without the human's go-ahead; when they agree, pass its URL with `--logo`.
27
+
28
+ ### Optional inputs
29
+
30
+ - **Functional specifications** (`--specs`): copied into `knowledge/inputs/specs/`. Read them before chapters 3 and 5; they are evidence level P2/P3 (`evidence-rules.md`). They explain the *why*; the metadata still decides the *what*.
31
+ - **Scope** (`--scope`): name patterns of the components the project owns. Out-of-scope components disappear from facts, counts and tables; standard objects and org-wide components (profiles, roles, queues, reports) stay. Package directories: `--package-dirs force-app,core`.
32
+ - **Quality inputs** (recommended): `platform-architecture-analyze` (Salesforce skill) for chapter 13 and the Improvement Axes; `dx-code-analyzer-run` → `tadforce/knowledge/inputs/code-analyzer-results.json`. See `salesforce-skills.md`.
33
+
34
+ ## 2. `build` — write, then build
35
+
36
+ Write first:
37
+
38
+ ```bash
39
+ npx tadforce next --json
40
+ ```
41
+
42
+ Loop until `remaining` is 0. For each section: spec → facts → code → content. Write the TAD first (chapters 1 to 15), then the Improvement Axes (`--doc axes`). Do not edit the generated tables: change the facts or the knowledge files instead.
43
+
44
+ Efficient order: 6 Data → 7 Application → 8 UI → 9 Integrations → 10 Security → 11-13 → 5 Functional → 4 General → 1-3 (the summary is written last, from what you learned). Run `npx tadforce validate` every few sections.
45
+
46
+ Then build:
47
+
48
+ ```bash
49
+ npx tadforce build --pdf --docx # HTML always; PDF and Word on demand
50
+ ```
51
+
52
+ Fix every error reported by the validation (pending sections, unknown placeholders, excluded components, forbidden terms, broken anchors, Mermaid errors, possible secrets). Review warnings: an unknown identifier is either a typo, a package component (fine, say so) or a hallucination (remove it).
53
+
54
+ The HTML keeps **one name across versions** (`out/TAD_<CODE>.html`): comments saved in it are carried into every rebuild. PDF and DOCX carry the version (`TAD_<CODE>_v1.0.pdf`) — they are archives.
55
+
56
+ Hand over, briefly: where the files are, the score, what is *to be confirmed*, and how to review.
57
+
58
+ ## 3. `review` — comments become fixes
59
+
60
+ The human runs `npx tadforce review`: the document opens from a local server and **Save writes into the same file** — no copies, no lost comments. (Opened by double-click, the page asks to pick the file: pick that same file.)
61
+
62
+ Then `/tadforce-review` (skill `tadforce-review`): `npx tadforce review --json` lists the open comments; each one becomes a fix in the sources and, when it is a rule, in the knowledge files.
63
+
64
+ ## 4. `update` — months later
65
+
66
+ ```bash
67
+ npx tadforce update --json
68
+ ```
69
+
70
+ Archives the previous facts in `facts/history/<date>/`, reads the org again (fresh snapshot), compares content fingerprints, bumps the version (`1.0 → 1.1`) with a line in the history, and returns the sections to review with the reasons (`changes`, `counts`, `sections[]` with file and anchor). Rewrite only those sections (skill `tadforce-update`), then `npx tadforce build`. Counts, tables, ERDs and appendices update by themselves.
71
+
72
+ ## Advanced commands (CI, experts)
73
+
74
+ `npx tadforce help --all`: `init`, `auth`, `detect`, `manifest [--mode full]`, `retrieve [--batch-size 5]`, `facts [--source <dir>]`, `prepare`, `scaffold`, `next`, `spec`, `validate`, `comments`, `status`, `install-skills`.
75
+
76
+ ## Failure handling
77
+
78
+ | Symptom | Action |
79
+ |---|---|
80
+ | `sf` asks to log in again | The human runs `npx tadforce doctor` (it opens the browser) |
81
+ | Retrieve batch fails | It retries type by type; read `.snapshot/retrieve-report.json`; rerun later or `npx tadforce retrieve --batch-size 5` |
82
+ | Mermaid error in a figure | Simplify the diagram (labels in quotes, no parentheses in node ids), rebuild |
83
+ | `unknown-component` warnings on package objects | Normal when the object belongs to a package: write it with its namespace |
84
+ | The human says a fact is wrong | Correct the knowledge file (exclusion, glossary) rather than the text, rerun facts, rebuild |
85
+ | Colours or logo wrong | Edit `tadforce.config.json › brand` / `client.logo`, or `doctor --json --logo <file>` |
@@ -0,0 +1,47 @@
1
+ # Writing rules — a document the client keeps
2
+
3
+ The reader is an architect, an application owner, an operations or security engineer of the client, or a developer joining the project. They read it on screen, print it, and come back to it months later.
4
+
5
+ ## Voice
6
+
7
+ - Present tense, as implemented: « The platform assigns… », not « will assign » or « should ».
8
+ - Factual and positive. Describe what exists and why it was designed this way. No blame, no defect list, no « unfortunately ».
9
+ - Precise and short: one idea per sentence; paragraphs of 2 to 5 sentences.
10
+ - The integrator's design choices are highlighted in `> [!INTEGRATOR]` callouts, sparingly (one per chapter at most).
11
+ - No marketing words (« revolutionary », « seamless », « best-in-class »).
12
+
13
+ ## Structure
14
+
15
+ - Keep the skeleton: chapters, sections and anchors are the same for every org; that is what makes TADForce documents comparable.
16
+ - Start each section with the sentence a reader needs if they read nothing else.
17
+ - Prefer a table when you compare three or more items on the same attributes.
18
+ - Lists: parallel grammar, no full stop for fragments, full stop for sentences.
19
+ - Cross-reference with `{{ref:id}}` instead of repeating content (« see {{ref:annex-automation}} »).
20
+ - Full inventories belong in the appendices (generated). Chapters keep the 5 to 10 items that matter.
21
+
22
+ ## Names
23
+
24
+ - Technical names in code font: `LoanApplication__c`, `LeadTriggerHandler`, `customer360`. They must exist in the inventory.
25
+ - Business labels in quotes: « Loan application » (FR: « Demande de prêt »).
26
+ - Salesforce terms in English in every language: Lead, Opportunity, Case, Queue, Record Type, Permission Set Group, Named Credential, Flow, OmniScript, Integration Procedure.
27
+ - External systems with the name from `glossary.yml`, nothing else.
28
+ - Apply `glossary.yml › terms` (`use` / `avoid`) everywhere, including figures.
29
+
30
+ ## Numbers
31
+
32
+ - Every count comes from a placeholder: `{{n:apex.classes}}`, `{{n:flows.active}}`, `{{n:security.permissionSetGroups}}`. The list of keys is in `facts.json › counts`.
33
+ - Thresholds read in code (batch size, number of retries) are written as numbers with the class that defines them.
34
+ - Never write a volume, a number of users or a performance figure that is not in the facts or the inputs.
35
+
36
+ ## Language
37
+
38
+ - Write in the document language. French: typographic conventions (espace insécable avant « : ; ! ? », guillemets « »), « vous » never used — impersonal style.
39
+ - Do not translate API names, picklist values or labels shown in the UI; quote them.
40
+
41
+ ## Length (indicative, a medium org)
42
+
43
+ Summary 1 page · chapters 2 to 4: 1 to 2 pages each · chapter 5: 1 page per domain · chapters 6 to 10: 2 to 5 pages each · chapters 11 to 15: half a page to 2 pages. Appendices: generated.
44
+
45
+ ## What never goes into the TAD
46
+
47
+ Debt, risks, code smells, scores, recommendations, team or vendor names other than the client and the integrator, personal data, credentials, record IDs, org IDs, URLs with tokens, decommissioned features, excluded components.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: tadforce-review
3
+ description: Process the review comments that readers left in a TADForce HTML document (Comment / Capture an area, then Save) — apply each correction to the sources and to the knowledge files so it survives regenerations, mark it resolved with an answer, rebuild. Use when the user says the document was reviewed or commented, shares a saved HTML file with comments, or runs /tadforce-review.
4
+ ---
5
+
6
+ # TADForce review loop
7
+
8
+ Readers comment directly in the HTML (💬 Comment, + Capture an area, 💾 Save). Comments are stored inside the file, with the quoted passage, the section and an optional screenshot. Your job: turn every comment into a lasting correction, and answer it.
9
+
10
+ The document has **one file across versions**: `tadforce/out/TAD_<CODE>.html`. The human opens it with `npx tadforce review`: Save in the page writes into that same file, so no comment is lost in a copy.
11
+
12
+ ## 1. Collect
13
+
14
+ ```bash
15
+ npx tadforce review --json # open comments of tadforce/out/TAD_<CODE>.html
16
+ npx tadforce review <path/to/other.html> --json
17
+ ```
18
+
19
+ If the human sent a copy from elsewhere (e-mail, downloads folder), use that path and add it to `commentsFrom` (step 3). Images are attached in the file: open the HTML in a browser if you need to see a capture.
20
+
21
+ ## 2. Classify each open comment
22
+
23
+ | Kind | Example | Where the fix goes |
24
+ |---|---|---|
25
+ | Terminology | « Say API Gateway, not passerelle, everywhere » | `knowledge/glossary.yml › terms` (`use` / `avoid`) **and** the text |
26
+ | System name | « This is not the legacy core banking, it is the Data Platform » | `glossary.yml › systems` (name, match) **and** the text and figures |
27
+ | Decommissioned | « This search was decommissioned, do not mention it » | `knowledge/exclusions.yml › features` (components, keywords) **and** remove from the text |
28
+ | Out of scope component | « This LWC is a POC » | `exclusions.yml › exclude` |
29
+ | Factual correction | « The batch runs every hour, not daily » | The text; check the metadata first and say if it contradicts the comment |
30
+ | Process change | « The flow is simpler now: … » | Rewrite the section from the new description; move open questions to the Improvement Axes |
31
+ | Layout / readability | « Table headers are not readable » | Report it to the human (template issue) or adjust the content (split a table) |
32
+
33
+ When the comment contradicts the metadata, do not silently obey: answer with the evidence and ask.
34
+
35
+ ## 3. Apply
36
+
37
+ 1. Edit `tadforce/src/<doc>/*.md` (never the built HTML).
38
+ 2. Edit the knowledge files; then `npx tadforce facts` if exclusions or systems changed.
39
+ 3. In `tadforce/tadforce.config.json`, under `review.<doc>`:
40
+ - comments of `out/TAD_<CODE>.html` itself are carried over automatically; only a copy saved elsewhere goes to `commentsFrom` (path relative to `tadforce/`);
41
+ - add one entry per handled comment to `resolutions`: `"<comment id>": "<what you changed, one or two sentences, with section numbers>"`;
42
+ - add ids to `dropImages` when a capture is no longer useful (keeps the file small).
43
+ 4. `npx tadforce build --pdf --docx` — handled comments appear as **resolved**, with your answer, in the panel of the same HTML file. When the readers also edited text in the page, the build keeps a copy (`…_comments_<date>.html`): report those edits into the sources.
44
+
45
+ ## 4. Report
46
+
47
+ One line per comment: id, section, what changed (or why not). Then the validation score. Ask the human to reopen the new HTML and check the resolved comments.
48
+
49
+ ## Rules
50
+
51
+ - A correction lands in the knowledge files whenever it is a rule (term, system, exclusion), so the next regeneration keeps it.
52
+ - Never delete a comment; resolve it with an answer.
53
+ - Apply a terminology fix everywhere (text, tables, figure labels, sequence participants), then run `npx tadforce validate` — forbidden terms are checked automatically.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: tadforce-update
3
+ description: Bring an existing TADForce Technical Architecture Document up to date after the org evolved (new or changed Apex, flows, objects, integrations, permissions, products) — reads the org again, compares with the facts the previous version was written from, rewrites only the impacted sections, bumps the version. Use when the user says the document is outdated, asks to refresh or update the TAD, mentions a new release or several months of changes, or runs /tadforce-update.
4
+ ---
5
+
6
+ # TADForce update — the document follows the org
7
+
8
+ The document already exists. Do not rewrite it: find what changed, and rewrite only what it touches. The rules of the `tadforce` skill still apply (no evidence, no sentence; numbers from facts; the client's vocabulary is law).
9
+
10
+ ## 1. Compare
11
+
12
+ ```bash
13
+ npx tadforce update --json
14
+ ```
15
+
16
+ It archives the previous facts (`tadforce/facts/history/<date>/`), retrieves a fresh snapshot (`source.mode`), recomputes the facts, compares content fingerprints and returns:
17
+
18
+ - `changes.added | changed | removed` — components, by metadata folder (`classes:InvoiceService`, `flows:Case_Routing`…);
19
+ - `counts` — every count that moved (`apex.classes: [132, 140]`);
20
+ - `sections[]` — the sections to review: `id`, `file`, `anchor` (the heading `{#id}` the section sits under) and the `reasons`;
21
+ - `from` → `to` — the version bump, already written to the document history.
22
+
23
+ Nothing changed: say so and stop.
24
+
25
+ ## 2. Ask, once
26
+
27
+ New external endpoints and new unused-looking components appear in `facts/questions.json`. Ask about them in one message (Blocks B and C of the `tadforce` skill's `references/questions.md`), write the knowledge files, rerun `npx tadforce facts`.
28
+
29
+ ## 3. Rewrite only what changed
30
+
31
+ For each section of `sections[]`:
32
+
33
+ 1. Open `file` at `anchor`, read the current text.
34
+ 2. Read the spec (`npx tadforce spec <id> --json`) and the changed metadata (`tadforce/.snapshot/source/...`). For a changed Apex class or flow, read the code: what the reader must learn is the new *behaviour*, not that a file changed.
35
+ 3. Edit the section: add the new components, update the behaviour that changed, remove what was deleted. Keep the heading and its anchor; keep everything that is still true word for word — readers have already validated it.
36
+ 4. Placeholders (`{{n:…}}`), generated tables, ERDs and appendices update by themselves: never edit them by hand.
37
+
38
+ A section listed only for moved counts usually needs no change: check that the text holds no number or statement that the new counts contradict.
39
+
40
+ Then, in chapter 15 (Outlook) or the Improvement Axes, record what the update revealed that the client should know (new debt goes to the Axes, never to the TAD).
41
+
42
+ ## 4. Build and report
43
+
44
+ ```bash
45
+ npx tadforce build --pdf --docx
46
+ ```
47
+
48
+ 0 errors. The HTML keeps its name: the comments readers left on the previous version are still in it. Report in a few lines: version `from → to`, the sections rewritten (with one line each on what changed), the questions still open. Ask the human to review the new version with `npx tadforce review`.