arcshape 0.0.0-stage → 0.1.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 (49) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +91 -2
  3. package/bin/arcshape.mjs +93 -0
  4. package/bin/confluence-pages.mjs +569 -0
  5. package/bin/confluence.mjs +263 -0
  6. package/bin/init.mjs +160 -0
  7. package/bin/product-citations.mjs +104 -0
  8. package/bin/session.mjs +753 -0
  9. package/bin/site.mjs +59 -0
  10. package/bin/sync.mjs +352 -0
  11. package/bin/validate-links.mjs +98 -0
  12. package/bin/validate.mjs +126 -0
  13. package/package.json +62 -4
  14. package/templates/architecture/01-introduction-and-goals.md +13 -0
  15. package/templates/architecture/02-constraints.md +13 -0
  16. package/templates/architecture/03-context-and-scope.md +11 -0
  17. package/templates/architecture/04-solution-strategy.md +13 -0
  18. package/templates/architecture/05-building-block-view.md +11 -0
  19. package/templates/architecture/06-runtime-view.md +9 -0
  20. package/templates/architecture/07-deployment-view.md +11 -0
  21. package/templates/architecture/08-crosscutting-concepts.md +13 -0
  22. package/templates/architecture/09-architecture-decisions.md +9 -0
  23. package/templates/architecture/10-quality-requirements.md +11 -0
  24. package/templates/architecture/11-risks-and-technical-debt.md +11 -0
  25. package/templates/architecture/12-glossary.md +10 -0
  26. package/templates/architecture/README.md +20 -0
  27. package/templates/assistants/.agents/skills/arcshape-adr/SKILL.md +16 -0
  28. package/templates/assistants/.agents/skills/arcshape-architecture/SKILL.md +35 -0
  29. package/templates/assistants/.agents/skills/arcshape-c4/SKILL.md +13 -0
  30. package/templates/assistants/.agents/skills/arcshape-docs-sync/SKILL.md +12 -0
  31. package/templates/assistants/.claude/commands/arcshape/adr.md +5 -0
  32. package/templates/assistants/.claude/commands/arcshape/c4.md +5 -0
  33. package/templates/assistants/.claude/commands/arcshape/document.md +5 -0
  34. package/templates/assistants/.claude/commands/arcshape/reverse-engineer.md +5 -0
  35. package/templates/assistants/.claude/commands/arcshape/sync.md +5 -0
  36. package/templates/assistants/.claude/skills/arcshape-adr/SKILL.md +16 -0
  37. package/templates/assistants/.claude/skills/arcshape-architecture/SKILL.md +35 -0
  38. package/templates/assistants/.claude/skills/arcshape-c4/SKILL.md +13 -0
  39. package/templates/assistants/.claude/skills/arcshape-docs-sync/SKILL.md +12 -0
  40. package/tools/arc42-site/LICENSE +21 -0
  41. package/tools/arc42-site/NOTICE.md +3 -0
  42. package/tools/arc42-site/README.md +3 -0
  43. package/tools/arc42-site/browser-options.mjs +14 -0
  44. package/tools/arc42-site/capture-evidence.mjs +84 -0
  45. package/tools/arc42-site/generate.mjs +227 -0
  46. package/tools/arc42-site/loadDocs.mjs +196 -0
  47. package/tools/arc42-site/render.mjs +411 -0
  48. package/tools/arc42-site/shell.mjs +761 -0
  49. package/tools/arc42-site/validate-diagrams.mjs +27 -0
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "arcshape",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "ArcShape tooling for creating and maintaining arc42 architecture documentation.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/juangcarmona/arcshape.git"
10
+ },
11
+ "homepage": "https://github.com/juangcarmona/arcshape#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/juangcarmona/arcshape/issues"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "bin": {
19
+ "arcshape": "bin/arcshape.mjs"
20
+ },
21
+ "files": [
22
+ "bin/",
23
+ "tools/arc42-site/",
24
+ "templates/",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "engines": {
29
+ "node": ">=22.0.0"
30
+ },
31
+ "dependencies": {
32
+ "@mermaid-js/mermaid-cli": "12.0.0",
33
+ "dompurify": "3.4.16",
34
+ "github-slugger": "2.0.0",
35
+ "ignore": "7.0.12",
36
+ "js-yaml": "5.4.3",
37
+ "jsdom": "27.4.0",
38
+ "marked": "15.0.12",
39
+ "puppeteer": "25.12.0",
40
+ "yauzl": "3.4.0"
41
+ },
42
+ "scripts": {
43
+ "format:check": "prettier --check \"bin/**/*.{js,mjs}\" \"tools/arc42-site/**/*.mjs\" \"scripts/**/*.{ts,js,mjs}\" \"tests/**/*.{ts,js,mjs}\" \"security/**/*.json\" \"*.js\" \"*.json\" \".github/workflows/*.yml\"",
44
+ "lint": "eslint bin scripts tests eslint.config.js",
45
+ "typecheck": "tsc --noEmit",
46
+ "test": "vitest run",
47
+ "build": "tsc",
48
+ "product:model:check": "node dist/scripts/check-product-model-status.js docs/product/model",
49
+ "security:audit": "node scripts/check-npm-audit.mjs",
50
+ "openspec:init": "openspec init --tools codex,claude",
51
+ "product:init": "prodshape init --sdd openspec --ai codex,claude --full",
52
+ "product:openspec:add": "prodshape integration add openspec"
53
+ },
54
+ "devDependencies": {
55
+ "@fission-ai/openspec": "1.14.2",
56
+ "@prodshape/cli": "0.22.0",
57
+ "@types/node": "24.13.3",
58
+ "eslint": "10.13.0",
59
+ "prettier": "3.9.6",
60
+ "typescript": "5.9.3",
61
+ "typescript-eslint": "8.65.0",
62
+ "vitest": "5.0.5"
63
+ }
64
+ }
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Introduction and goals
3
+ arc42-section: "01"
4
+ description: System purpose, stakeholders, and architecture goals.
5
+ ---
6
+
7
+ # 1. Introduction and goals
8
+
9
+ ## Requirements overview
10
+
11
+ ## Quality goals
12
+
13
+ ## Stakeholders
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Architecture constraints
3
+ arc42-section: "02"
4
+ description: Technical, organizational, and convention constraints that shape the architecture.
5
+ ---
6
+
7
+ # 2. Architecture constraints
8
+
9
+ ## Technical constraints
10
+
11
+ ## Organizational constraints
12
+
13
+ ## Conventions
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: System scope and context
3
+ arc42-section: "03"
4
+ description: The system boundary, its users, and its external interfaces.
5
+ ---
6
+
7
+ # 3. System scope and context
8
+
9
+ ## Business context
10
+
11
+ ## Technical context
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Solution strategy
3
+ arc42-section: "04"
4
+ description: Fundamental decisions and strategies that shape the architecture.
5
+ ---
6
+
7
+ # 4. Solution strategy
8
+
9
+ ## Technology decisions
10
+
11
+ ## Top-level decomposition
12
+
13
+ ## Quality realization
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Building block view
3
+ arc42-section: "05"
4
+ description: The static decomposition of the system into building blocks.
5
+ ---
6
+
7
+ # 5. Building block view
8
+
9
+ ## Level 1: system
10
+
11
+ ## Level 2: building blocks
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Runtime view
3
+ arc42-section: "06"
4
+ description: Runtime behavior and important interactions between building blocks.
5
+ ---
6
+
7
+ # 6. Runtime view
8
+
9
+ ## Runtime scenarios
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Deployment view
3
+ arc42-section: "07"
4
+ description: Infrastructure and environment mapping for the system.
5
+ ---
6
+
7
+ # 7. Deployment view
8
+
9
+ ## Infrastructure overview
10
+
11
+ ## Deployment mapping
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Cross-cutting concepts
3
+ arc42-section: "08"
4
+ description: Concepts and rules that affect multiple building blocks.
5
+ ---
6
+
7
+ # 8. Cross-cutting concepts
8
+
9
+ ## Domain model
10
+
11
+ ## Security and privacy
12
+
13
+ ## Observability and operations
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Architecture decisions
3
+ arc42-section: "09"
4
+ description: Important architecture decisions and links to their records.
5
+ ---
6
+
7
+ # 9. Architecture decisions
8
+
9
+ Link the accepted Architecture Decision Records that explain consequential choices.
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Quality requirements
3
+ arc42-section: "10"
4
+ description: Quality goals and concrete scenarios for evaluating them.
5
+ ---
6
+
7
+ # 10. Quality requirements
8
+
9
+ ## Quality tree
10
+
11
+ ## Quality scenarios
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Risks and technical debt
3
+ arc42-section: "11"
4
+ description: Known risks, technical debt, and their planned responses.
5
+ ---
6
+
7
+ # 11. Risks and technical debt
8
+
9
+ ## Risks
10
+
11
+ ## Technical debt
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: Glossary
3
+ arc42-section: "12"
4
+ description: Domain and architecture terminology used in this documentation.
5
+ ---
6
+
7
+ # 12. Glossary
8
+
9
+ | Term | Definition |
10
+ | ---- | ---------- |
@@ -0,0 +1,20 @@
1
+ # Architecture documentation
2
+
3
+ This directory contains the system's canonical architecture documentation in Markdown. It follows the twelve sections of [arc42](https://arc42.org/).
4
+
5
+ ## Sections
6
+
7
+ 1. [Introduction and goals](01-introduction-and-goals.md)
8
+ 2. [Architecture constraints](02-constraints.md)
9
+ 3. [System scope and context](03-context-and-scope.md)
10
+ 4. [Solution strategy](04-solution-strategy.md)
11
+ 5. [Building block view](05-building-block-view.md)
12
+ 6. [Runtime view](06-runtime-view.md)
13
+ 7. [Deployment view](07-deployment-view.md)
14
+ 8. [Cross-cutting concepts](08-crosscutting-concepts.md)
15
+ 9. [Architecture decisions](09-architecture-decisions.md)
16
+ 10. [Quality requirements](10-quality-requirements.md)
17
+ 11. [Risks and technical debt](11-risks-and-technical-debt.md)
18
+ 12. [Glossary](12-glossary.md)
19
+
20
+ Keep Markdown as the source of truth. Separate known implementation evidence from assumptions and open questions; do not treat an inferred decision as accepted.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: arcshape-adr
3
+ description: Draft, review, and maintain Markdown Architecture Decision Records from a decision supplied by a maintainer and supporting repository evidence. Use when a durable architecture trade-off needs a record.
4
+ ---
5
+
6
+ # ArcShape ADR workflow
7
+
8
+ 1. Confirm the decision being made and who has authority to accept it. If the decision itself is unknown, ask; do not infer a choice from implementation alone.
9
+ 2. Inspect existing ADR conventions, indexes, relevant arc42 sections, and evidence. Default only when no repository convention exists: `docs/adr/` with four-digit sequential filenames.
10
+ 3. Draft a Markdown ADR with Context, Decision, Alternatives considered, Consequences, and References. Separate supplied decisions from observed facts and unresolved assumptions.
11
+ 4. New records are Proposed unless the maintainer explicitly says the decision is accepted. Include the rejected alternatives and why they were rejected.
12
+ 5. Never rewrite history to reverse a decision. Propose a new ADR and show any superseding relationship for review. Keep the existing ADR's status until the new decision is accepted; then mark the old record superseded. Confirm the relationship with the maintainer before recording it.
13
+ 6. Update an existing ADR index if the repository has one. For an accepted decision, update arc42 section 09 when present with a concise decision, ADR link, and affected architecture. Do not put proposed decisions in the current architecture index.
14
+ 7. Show the complete diff and summarize open questions. Leave acceptance to the maintainer.
15
+
16
+ Keep the ADR and its index in Markdown. Do not invent a repository index if the project has none; report that clearly.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: arcshape-architecture
3
+ description: Reverse engineer, create, and maintain evidence-grounded arc42 architecture documentation in Markdown for any repository. Use when documenting a system, improving architecture docs, or reconciling docs with implementation evidence.
4
+ ---
5
+
6
+ # ArcShape architecture documentation
7
+
8
+ Use this skill to understand a repository and propose accurate architecture documentation. The repository language and stack are not prerequisites: follow evidence in Markdown, configuration, source, tests, deployment manifests, and operational files.
9
+
10
+ ## Operating rules
11
+
12
+ - Treat existing repository evidence as observations, not proof of intent. Distinguish observed behavior, maintainer-supplied intent, and proposals.
13
+ - Never claim a subsystem or behavior is implemented based only on plans, issue text, or generated docs. Cite concrete paths and relevant sections in the working notes.
14
+ - Surface contradictions, gaps, uncertainty, and stale documentation. Ask the maintainer when a decision or intent cannot be inferred safely.
15
+ - Preserve the project's existing architecture documentation conventions. ArcShape's default Markdown location is `docs/architecture/` with the 12 numbered arc42 sections.
16
+ - Draft changes for review. Do not declare proposals accepted or silently overwrite a maintainer's authored material.
17
+ - Keep diagrams in Mermaid inside Markdown. Prefer C4 context/container/component views and label relationships with concise meaning.
18
+
19
+ ## Reverse engineering workflow
20
+
21
+ 1. Inspect repository guidance, existing architecture docs, ADRs, product definition, and recent changes before analyzing implementation.
22
+ 2. Start or resume a bounded evidence session with `arcshape session start` / `arcshape session status` / `arcshape session next`. Use each returned round to inspect sources; do not attempt to read the entire repository in one pass.
23
+ 3. For each source, record its classification and what it establishes with `arcshape session mark`. Record newly discovered paths as leads and unresolved intent as questions. Correct mistakes with `unmark`; preserve uncertainty instead of filling gaps.
24
+ 4. Track coverage and changed evidence. Re-read sources ArcShape reports as changed before relying on earlier notes. Continue until the session report distinguishes reviewed, excluded, pending, and changed evidence.
25
+ 5. Build a compact evidence map: system boundary, users/external systems, runtime units, interfaces, data stores, deployment, cross-cutting mechanisms, quality goals, risks, and unknowns. Link every material claim to evidence.
26
+ 6. Compare the evidence map with the 12 arc42 sections. Propose focused Markdown edits, marking inferred claims and unresolved questions for maintainer review.
27
+ 7. Review all internal links and Mermaid syntax, then build the reader site with `arcshape site build` and inspect the generated output.
28
+
29
+ ## Maintain documentation
30
+
31
+ When docs already exist, compare each claim against current evidence. Preserve accurate content, correct stale details, remove duplication, and record unresolved discrepancies. Do not rewrite sections merely to fit a template. Keep source Markdown canonical; the HTML site is generated output.
32
+
33
+ ## CLI tools
34
+
35
+ Use the CLI for repeatable operations: `arcshape init`, `arcshape session ...`, `arcshape validate`, `arcshape sync ...`, and `arcshape site build`. Run `arcshape validate --links --citations` when the repository has a ProductShape model. Citation validation uses the repository's installed `@prodshape/cli`; it reports stale citations as warnings and unresolved citations as errors. Do not rewrite citations automatically. This skill owns repository interpretation, questions, and proposed documentation. Report when a requested deterministic CLI subcommand is unavailable; do not invent one.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: arcshape-c4
3
+ description: Create and maintain evidence-grounded C4 architecture diagrams as Mermaid in Markdown. Use when a maintainer asks for context, container, component, or code views.
4
+ ---
5
+
6
+ # ArcShape C4 diagram workflow
7
+
8
+ 1. Inspect current documentation, repository structure, runtime configuration, deployment, interfaces, and tests. Ask the maintainer about external actors or intended boundaries that evidence cannot establish.
9
+ 2. Choose the smallest useful C4 level: context, container, component, or code. Do not produce every level by default.
10
+ 3. Draft Mermaid `C4Context`, `C4Container`, or `C4Component` diagrams in the appropriate Markdown arc42 section. Keep names and relationship labels concise.
11
+ 4. Ground nodes and relationships in evidence. Mark inferred boundaries and unknown relationships for review; do not imply that a planned component exists.
12
+ 5. Preserve existing correct diagrams and propose focused edits. When evidence changes, update only affected nodes, relationships, and adjacent explanation; leave unrelated authored content unchanged and show the diff. Do not overwrite diagrams from external sources without review.
13
+ 6. Run `arcshape site build` and inspect the rendered diagram. Report Mermaid render failures and unresolved assumptions.
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: arcshape-docs-sync
3
+ description: Connect repository architecture Markdown to Obsidian or Confluence while keeping the repository copy reviewable and canonical. Use when a maintainer asks to link, export, or publish architecture documentation.
4
+ ---
5
+
6
+ # ArcShape documentation connections
7
+
8
+ 1. Confirm the source Markdown directory and the target vault or documentation space with the maintainer. Treat repository Markdown as canonical unless the maintainer explicitly describes another source of truth.
9
+ 2. For an Obsidian vault, preview with `arcshape sync obsidian --vault <vault> --include <ADR-directory> --dry-run` when ADRs live outside `docs/architecture`. The selected Markdown roots are copied with their relative structure so links between architecture docs and ADRs remain usable. Review target and file actions, then run without `--dry-run` when the maintainer has asked to sync. ArcShape updates only copies that still match its prior managed version; conflicts preserve vault edits for human reconciliation.
10
+ 3. For Confluence Cloud, preview a multi-page architecture publication with `arcshape sync confluence --base-url <url> --space-id <id> --parent-id <id> --title-prefix <project> --dry-run`. This creates an index and one page per arc42 section under the selected parent. Add repeatable `--include <file-or-directory>` options for selected ADR or C4 Markdown outside `docs/architecture`. For an existing single-page destination, use `--page-id <id>` instead. Credentials must be supplied in environment variables; never put tokens in repository files or command arguments. The CLI stops when a managed remote page changed since the last sync. Remove `--dry-run` only when the maintainer has asked to publish that content.
11
+ 4. Never copy credentials into repository files, include private content outside the requested scope, or silently overwrite an externally edited document.
12
+ 5. Report which files/pages were linked, created, updated, unchanged, or conflicted. Keep canonical Markdown and external-system references traceable.
@@ -0,0 +1,5 @@
1
+ # /arcshape:adr
2
+
3
+ Draft or maintain a Markdown Architecture Decision Record.
4
+
5
+ Use the `arcshape-adr` skill. Ask for the decision when it is not supplied; distinguish maintainer decisions from facts inferred from repository evidence. Keep the ADR Proposed unless acceptance is explicit, preserve history, update an existing index, and present the diff for review.
@@ -0,0 +1,5 @@
1
+ # /arcshape:c4
2
+
3
+ Create or update an evidence-grounded C4 diagram in Markdown.
4
+
5
+ Use the `arcshape-c4` skill. Select the smallest useful C4 level, use Mermaid, ground nodes and relationships in repository evidence, call out unknown boundaries, then build and inspect the site. Present the diff for review.
@@ -0,0 +1,5 @@
1
+ # /arcshape:document
2
+
3
+ Create or improve this repository's arc42 architecture documentation in Markdown.
4
+
5
+ Use the `arcshape-architecture` skill. Review existing docs and implementation evidence, update only supported claims, surface gaps, and build the reader site with `arcshape site build` for review. Preserve source Markdown as canonical and show the proposed diff.
@@ -0,0 +1,5 @@
1
+ # /arcshape:reverse-engineer
2
+
3
+ Reverse engineer this repository's architecture and prepare evidence-grounded Markdown documentation.
4
+
5
+ Use the `arcshape-architecture` skill. Start or resume a bounded session with `arcshape session`, inspect one round at a time, record coverage and unresolved questions, then propose focused edits to `docs/architecture/`. Keep observed behavior separate from plans and maintainer intent. Do not accept changes on the maintainer's behalf.
@@ -0,0 +1,5 @@
1
+ # /arcshape:sync
2
+
3
+ Connect this repository's architecture Markdown to the documentation system used by the project.
4
+
5
+ Use the `arcshape-docs-sync` skill. It documents ArcShape's native Obsidian and Confluence CLI commands, preview options, credential handling, and conflict behavior. Prepare a reviewable preview and publish only after the maintainer asks.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: arcshape-adr
3
+ description: Draft, review, and maintain Markdown Architecture Decision Records from a decision supplied by a maintainer and supporting repository evidence. Use when a durable architecture trade-off needs a record.
4
+ ---
5
+
6
+ # ArcShape ADR workflow
7
+
8
+ 1. Confirm the decision being made and who has authority to accept it. If the decision itself is unknown, ask; do not infer a choice from implementation alone.
9
+ 2. Inspect existing ADR conventions, indexes, relevant arc42 sections, and evidence. Default only when no repository convention exists: `docs/adr/` with four-digit sequential filenames.
10
+ 3. Draft a Markdown ADR with Context, Decision, Alternatives considered, Consequences, and References. Separate supplied decisions from observed facts and unresolved assumptions.
11
+ 4. New records are Proposed unless the maintainer explicitly says the decision is accepted. Include the rejected alternatives and why they were rejected.
12
+ 5. Never rewrite history to reverse a decision. Propose a new ADR and show any superseding relationship for review. Keep the existing ADR's status until the new decision is accepted; then mark the old record superseded. Confirm the relationship with the maintainer before recording it.
13
+ 6. Update an existing ADR index if the repository has one. For an accepted decision, update arc42 section 09 when present with a concise decision, ADR link, and affected architecture. Do not put proposed decisions in the current architecture index.
14
+ 7. Show the complete diff and summarize open questions. Leave acceptance to the maintainer.
15
+
16
+ Keep the ADR and its index in Markdown. Do not invent a repository index if the project has none; report that clearly.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: arcshape-architecture
3
+ description: Reverse engineer, create, and maintain evidence-grounded arc42 architecture documentation in Markdown for any repository. Use when documenting a system, improving architecture docs, or reconciling docs with implementation evidence.
4
+ ---
5
+
6
+ # ArcShape architecture documentation
7
+
8
+ Use this skill to understand a repository and propose accurate architecture documentation. The repository language and stack are not prerequisites: follow evidence in Markdown, configuration, source, tests, deployment manifests, and operational files.
9
+
10
+ ## Operating rules
11
+
12
+ - Treat existing repository evidence as observations, not proof of intent. Distinguish observed behavior, maintainer-supplied intent, and proposals.
13
+ - Never claim a subsystem or behavior is implemented based only on plans, issue text, or generated docs. Cite concrete paths and relevant sections in the working notes.
14
+ - Surface contradictions, gaps, uncertainty, and stale documentation. Ask the maintainer when a decision or intent cannot be inferred safely.
15
+ - Preserve the project's existing architecture documentation conventions. ArcShape's default Markdown location is `docs/architecture/` with the 12 numbered arc42 sections.
16
+ - Draft changes for review. Do not declare proposals accepted or silently overwrite a maintainer's authored material.
17
+ - Keep diagrams in Mermaid inside Markdown. Prefer C4 context/container/component views and label relationships with concise meaning.
18
+
19
+ ## Reverse engineering workflow
20
+
21
+ 1. Inspect repository guidance, existing architecture docs, ADRs, product definition, and recent changes before analyzing implementation.
22
+ 2. Start or resume a bounded evidence session with `arcshape session start` / `arcshape session status` / `arcshape session next`. Use each returned round to inspect sources; do not attempt to read the entire repository in one pass.
23
+ 3. For each source, record its classification and what it establishes with `arcshape session mark`. Record newly discovered paths as leads and unresolved intent as questions. Correct mistakes with `unmark`; preserve uncertainty instead of filling gaps.
24
+ 4. Track coverage and changed evidence. Re-read sources ArcShape reports as changed before relying on earlier notes. Continue until the session report distinguishes reviewed, excluded, pending, and changed evidence.
25
+ 5. Build a compact evidence map: system boundary, users/external systems, runtime units, interfaces, data stores, deployment, cross-cutting mechanisms, quality goals, risks, and unknowns. Link every material claim to evidence.
26
+ 6. Compare the evidence map with the 12 arc42 sections. Propose focused Markdown edits, marking inferred claims and unresolved questions for maintainer review.
27
+ 7. Review all internal links and Mermaid syntax, then build the reader site with `arcshape site build` and inspect the generated output.
28
+
29
+ ## Maintain documentation
30
+
31
+ When docs already exist, compare each claim against current evidence. Preserve accurate content, correct stale details, remove duplication, and record unresolved discrepancies. Do not rewrite sections merely to fit a template. Keep source Markdown canonical; the HTML site is generated output.
32
+
33
+ ## CLI tools
34
+
35
+ Use the CLI for repeatable operations: `arcshape init`, `arcshape session ...`, `arcshape validate`, `arcshape sync ...`, and `arcshape site build`. Run `arcshape validate --links --citations` when the repository has a ProductShape model. Citation validation uses the repository's installed `@prodshape/cli`; it reports stale citations as warnings and unresolved citations as errors. Do not rewrite citations automatically. This skill owns repository interpretation, questions, and proposed documentation. Report when a requested deterministic CLI subcommand is unavailable; do not invent one.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: arcshape-c4
3
+ description: Create and maintain evidence-grounded C4 architecture diagrams as Mermaid in Markdown. Use when a maintainer asks for context, container, component, or code views.
4
+ ---
5
+
6
+ # ArcShape C4 diagram workflow
7
+
8
+ 1. Inspect current documentation, repository structure, runtime configuration, deployment, interfaces, and tests. Ask the maintainer about external actors or intended boundaries that evidence cannot establish.
9
+ 2. Choose the smallest useful C4 level: context, container, component, or code. Do not produce every level by default.
10
+ 3. Draft Mermaid `C4Context`, `C4Container`, or `C4Component` diagrams in the appropriate Markdown arc42 section. Keep names and relationship labels concise.
11
+ 4. Ground nodes and relationships in evidence. Mark inferred boundaries and unknown relationships for review; do not imply that a planned component exists.
12
+ 5. Preserve existing correct diagrams and propose focused edits. When evidence changes, update only affected nodes, relationships, and adjacent explanation; leave unrelated authored content unchanged and show the diff. Do not overwrite diagrams from external sources without review.
13
+ 6. Run `arcshape site build` and inspect the rendered diagram. Report Mermaid render failures and unresolved assumptions.
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: arcshape-docs-sync
3
+ description: Connect repository architecture Markdown to Obsidian or Confluence while keeping the repository copy reviewable and canonical. Use when a maintainer asks to link, export, or publish architecture documentation.
4
+ ---
5
+
6
+ # ArcShape documentation connections
7
+
8
+ 1. Confirm the source Markdown directory and the target vault or documentation space with the maintainer. Treat repository Markdown as canonical unless the maintainer explicitly describes another source of truth.
9
+ 2. For an Obsidian vault, preview with `arcshape sync obsidian --vault <vault> --include <ADR-directory> --dry-run` when ADRs live outside `docs/architecture`. The selected Markdown roots are copied with their relative structure so links between architecture docs and ADRs remain usable. Review target and file actions, then run without `--dry-run` when the maintainer has asked to sync. ArcShape updates only copies that still match its prior managed version; conflicts preserve vault edits for human reconciliation.
10
+ 3. For Confluence Cloud, preview a multi-page architecture publication with `arcshape sync confluence --base-url <url> --space-id <id> --parent-id <id> --title-prefix <project> --dry-run`. This creates an index and one page per arc42 section under the selected parent. Add repeatable `--include <file-or-directory>` options for selected ADR or C4 Markdown outside `docs/architecture`. For an existing single-page destination, use `--page-id <id>` instead. Credentials must be supplied in environment variables; never put tokens in repository files or command arguments. The CLI stops when a managed remote page changed since the last sync. Remove `--dry-run` only when the maintainer has asked to publish that content.
11
+ 4. Never copy credentials into repository files, include private content outside the requested scope, or silently overwrite an externally edited document.
12
+ 5. Report which files/pages were linked, created, updated, unchanged, or conflicted. Keep canonical Markdown and external-system references traceable.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Juan G. Carmona
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ # arc42 snapshot generator notice
2
+
3
+ The generator in this directory is copied from the `architecture-docs` skill available to Raccord maintainers and is provided under the MIT License in `LICENSE`. Its runtime dependencies are pinned by `package-lock.json`; the canonical architecture content remains in `docs/architecture/arc42/`.
@@ -0,0 +1,3 @@
1
+ # ArcShape static site renderer
2
+
3
+ The self-contained arc42 renderer is adapted from Raccord's `arc42-snapshot` tool and retains its MIT license and notice in this directory. It validates the Markdown section contract, sanitizes rendered HTML, and pre-renders accessible Mermaid diagrams into one navigable HTML file. ArcShape's canonical source remains `docs/architecture/*.md`.
@@ -0,0 +1,14 @@
1
+ export function getPuppeteerLaunchOptions(environment = process.env) {
2
+ return {
3
+ args:
4
+ environment.GITHUB_ACTIONS === "true"
5
+ ? [
6
+ "--no-sandbox",
7
+ "--disable-setuid-sandbox",
8
+ "--disable-dev-shm-usage",
9
+ "--disable-crash-reporter",
10
+ "--disable-breakpad",
11
+ ]
12
+ : [],
13
+ };
14
+ }
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { mkdir } from "node:fs/promises";
4
+ import { resolve, join } from "node:path";
5
+ import { pathToFileURL } from "node:url";
6
+ import puppeteer from "puppeteer";
7
+ import { getPuppeteerLaunchOptions } from "./browser-options.mjs";
8
+
9
+ const [siteArgument, outputArgument] = process.argv.slice(2);
10
+ if (!siteArgument || !outputArgument) {
11
+ process.stderr.write(
12
+ "Usage: node capture-evidence.mjs <site.html> <output-directory>\n",
13
+ );
14
+ process.exit(2);
15
+ }
16
+
17
+ const site = resolve(siteArgument);
18
+ const output = resolve(outputArgument);
19
+ await mkdir(output, { recursive: true });
20
+ const browser = await puppeteer.launch({
21
+ headless: true,
22
+ ...getPuppeteerLaunchOptions(),
23
+ });
24
+
25
+ try {
26
+ const page = await browser.newPage();
27
+ await page.setViewport({ width: 1440, height: 1000, deviceScaleFactor: 1 });
28
+ const siteUrl = pathToFileURL(site).href;
29
+ await page.goto(`${siteUrl}#/`, { waitUntil: "load" });
30
+ await page.waitForSelector("#content .overview-intro");
31
+ await page.screenshot({ path: join(output, "arcshape-overview.png") });
32
+
33
+ await page.goto(`${siteUrl}#/section/03`, { waitUntil: "load" });
34
+ await page.waitForFunction(
35
+ () =>
36
+ location.hash === "#/section/03" &&
37
+ document.querySelector(".doc figure.diagram svg"),
38
+ );
39
+ await page.evaluate(() => {
40
+ const main = document.querySelector("main#main");
41
+ const diagram = document.querySelector(".doc figure.diagram");
42
+ if (main && diagram) {
43
+ main.style.scrollBehavior = "auto";
44
+ const mainBounds = main.getBoundingClientRect();
45
+ const diagramBounds = diagram.getBoundingClientRect();
46
+ main.scrollTop = Math.max(
47
+ 0,
48
+ main.scrollTop +
49
+ diagramBounds.top -
50
+ mainBounds.top -
51
+ (main.clientHeight - diagramBounds.height) / 2,
52
+ );
53
+ }
54
+ });
55
+ await page.screenshot({ path: join(output, "arcshape-system-context.png") });
56
+
57
+ await page.goto(`${siteUrl}#/section/05`, { waitUntil: "load" });
58
+ await page.waitForFunction(
59
+ () =>
60
+ location.hash === "#/section/05" &&
61
+ document.querySelector(".doc figure.diagram svg"),
62
+ );
63
+ await page.evaluate(() => {
64
+ const main = document.querySelector("main#main");
65
+ const diagram = document.querySelector(".doc figure.diagram");
66
+ if (main && diagram) {
67
+ main.style.scrollBehavior = "auto";
68
+ const mainBounds = main.getBoundingClientRect();
69
+ const diagramBounds = diagram.getBoundingClientRect();
70
+ main.scrollTop = Math.max(
71
+ 0,
72
+ main.scrollTop +
73
+ diagramBounds.top -
74
+ mainBounds.top -
75
+ (main.clientHeight - diagramBounds.height) / 2,
76
+ );
77
+ }
78
+ });
79
+ await page.screenshot({
80
+ path: join(output, "arcshape-building-blocks.png"),
81
+ });
82
+ } finally {
83
+ await browser.close();
84
+ }