Architecture Docs From Mixed Sources
What This Skill Produces
- Normalized evidence inventory from heterogeneous sources (
.doc,.docx,.pdf,.txt,.md,.msg). - Consolidated architecture facts and assumptions with traceability.
- Architecture documents generated from project templates.
- Architecture options analysis with pros and cons when no established architecture is available.
- Additional architecture outputs aligned with architecture playbooks.
- Architecture image prompt packs aligned with architecture image prompt playbooks.
- Auto-created template folders/files when missing.
- Incremental updates that preserve prior outputs and update only changed areas.
- A maintained architecture timeline of decisions, source changes, and document revisions.
Use When
- You need to transform fragmented project knowledge into formal architecture documentation.
- Inputs span wiki exports, meeting notes/transcripts, mails, and ad-hoc docs.
- You want a repeatable process portable across repositories.
- You prefer to provide only one source root and let the skill auto-discover everything else.
- Inputs keep changing over time and documents must stay current without losing history.
Required Input
- Exactly one path:
inputSourceFolder. - This folder can be either:
- A combined source root that already contains mixed artifacts.
- A workspace root from which the skill auto-discovers subfolders (for example:
wikis,meetings,mails,additional-context-docs,docs). - An empty folder for first-time setup; in this case the skill must create the expected source and output structure automatically.
Detail-First Generation Mechanism (Default)
Use detailed-sequential generation by default.
Process rules:
- Generate one major document at a time, complete it, run a file-level quality gate, then continue.
- Avoid broad shallow generation across all outputs at once.
- Process files in this order:
- primary architecture design document from template set
- workflow/business logic document
- data model document
- playbook-applied architecture document
- architecture options document (conditional)
- diagrams and image prompts
- Only after core documents pass depth checks, finalize traceability and timeline updates.
Minimum depth gate per narrative document:
- Section content must be concrete and implementation-relevant.
- Each major claim must include at least one evidence/source reference.
- Include assumptions, risks, and unresolved questions explicitly.
- Prefer tables/examples where they improve clarity.
- Replace generic placeholders with focused
TBDquestions when evidence is missing.
Document-family depth gates:
- Architecture design document(s)
- Must be fully written, not outline-only.
- Must include business context, scope, component boundaries, data/integration, deployment, NFRs, risks, and decisions.
- Must include section-level source references.
- Image prompts
- Must include a detailed prompt per required diagram family.
- Must specify scope, style, labels, composition, and architecture reference.
- Open questions
- Must be specific, grouped by topic, and tied to source gaps or decisions.
- Each question must explain why it blocks or constrains the architecture.
- Architecture options document (conditional)
- Must include at least three options, detailed pros/cons, and a recommendation.
Packaged Defaults
Resolve defaults from the skill package itself:
- Template assets:
- Primary: workspace template bundle
- Fallback: starter templates
- Architecture and image playbooks:
- Output root (separate folder):
generated-architecture-output/
Reference: packaged defaults
Output Contract
Create or update these outputs under generated-architecture-output/ (or an equivalent dedicated output root if already configured):
evidence/evidence-index.mdevidence/source-facts.mdarchitecture/documents generated from templatesimage-prompts/prompt files aligned to image playbook formattraceability/requirements-to-evidence-map.mdtraceability/open-questions.mdtimeline/architecture-timeline.mdtimeline/source-change-log.mdtimeline/document-revision-log.md.state/last-run-source-snapshot.json.state/last-run-doc-checksums.json
Conditional output (required when architecture baseline is not established in sources):
architecture/Architecture_Options_Pros_Cons.md
Structure compatibility rule:
- Keep old output-structure files when they already exist.
- When generating updated outputs, also update equivalent old-structure files so downstream consumers keep working.
- If an old-structure file has no equivalent in the current run, leave it unchanged and mark it as
legacy-unmappedin the revision log.
When output folders do not exist, create them before processing.
Procedure
- Discover and validate paths from one input.
- Confirm
inputSourceFolderexists. - Auto-discover source folders from
inputSourceFolderand common children (wikis,meetings,mails,additional-context-docs,docs). - Resolve template/playbook paths from packaged defaults.
- If primary packaged assets are missing, use fallback packaged templates and continue.
- Bootstrap empty input folder when needed.
- If
inputSourceFolderhas no supported files and no expected source subfolders, create:
wikis/meetings/mails/additional-context-docs/docs/
- Add placeholder notes (
README.md) in each created source subfolder describing what to place there. - Create output scaffold immediately:
generated-architecture-output/evidence/generated-architecture-output/architecture/generated-architecture-output/image-prompts/generated-architecture-output/traceability/generated-architecture-output/timeline/generated-architecture-output/.state/
- Record this as
Initial scaffold createdintraceability/open-questions.md.
- Bootstrap template assets when missing.
- Ensure output template workspace exists under generated outputs.
- Ensure required template files exist; if missing, copy from workspace template bundle or fallback default templates.
- Record bootstrapped files in
traceability/open-questions.mdasAuto-created assetnotes.
- Initialize update mode and state.
- If
.state/last-run-source-snapshot.jsonexists, run in incremental mode. - If state is missing, run in baseline mode and create initial state.
- Never delete prior timeline files; only append new entries with timestamps.
- Use
.state/last-run-doc-checksums.jsonto detect changed source documents and changed generated docs. - Regenerate only impacted artifacts while preserving stable docs.
- Build evidence inventory.
- Recursively enumerate supported files in source folders.
- Record per-file metadata: path, type, last modified date, and inferred topic.
- De-duplicate near-identical files by filename/date/content hash when available.
- Detect source deltas.
- Compare current inventory with prior snapshot and classify each file as
added,updated,removed, orunchanged. - Prioritize extraction and downstream regeneration based on changed files first.
- Record delta summary in
timeline/source-change-log.md. - Treat document deltas (
.md,.docx,.pdf,.txt,.msg) as first-class triggers for architecture updates.
- Extract text from sources.
- For
.txt,.md: parse directly. - For
.pdf: extract text with available tooling. - For
.doc/.docx: extract text with available tooling. - For
.msg: capture sender/subject/date/body and relevant attachments when accessible. - If extraction fails for a file, log it in
traceability/open-questions.mdand continue.
- Normalize and classify facts.
- Convert extracted text into structured fact cards:
- Functional behavior
- Non-functional requirements
- Integrations and external dependencies
- Data entities and flows
- Security/compliance constraints
- Deployment/runtime constraints
- Tag each fact with source references.
- Separate explicit facts from inferred assumptions.
- Resolve conflicts and ambiguity.
- Detect contradictory facts (for example, two different API contracts).
- Apply precedence rules:
- Approved architecture docs
- Official API specs
- Recent meeting decisions
- Email discussions
- Older notes
- Keep conflicts and unresolved items in
traceability/open-questions.md.
- Generate architecture options when baseline is missing.
- If sources do not define a clear existing architecture baseline, create
architecture/Architecture_Options_Pros_Cons.md. - Include at least three viable options.
- For each option, document:
- Option summary
- Pros
- Cons
- Risks
- Operational impact
- Migration complexity
- Add a recommended option with decision rationale and assumptions.
- Generate architecture docs from templates.
- For each template, generate a filled document using normalized facts.
- Preserve template section structure and headings.
- Leave no section blank; if unknown, write
TBDplus blocking question. - Add a
Sourcesblock per section listing evidence references. - In incremental mode, update only impacted sections when possible and preserve stable sections.
- Keep chronology out of architecture documents; store all run/change history only under
timeline/.
- Generate playbook-aligned architecture artifacts.
- Apply architecture playbook instructions to produce required companion docs.
- Ensure terminology consistency across all generated docs.
- Validate document set covers context, components, interactions, data, deployment, risks, and decisions.
- Generate architecture image prompt packs.
- Apply architecture image prompt playbook formatting.
- Produce prompt variants per major diagram type (for example: context, component, deployment, data flow).
- Include explicit style, labeling, and scope constraints in each prompt.
- Maintain timeline artifacts.
- Append one entry per run in
timeline/architecture-timeline.mdwith date/time, key decisions, risks, and major doc changes. - Append document-level changes to
timeline/document-revision-log.mdwith file path, section, change type, and evidence references. - Ensure removed/obsolete source files are represented as timeline events, not silently discarded.
- Run quality checks.
- Completeness check: all template sections addressed.
- Traceability check: each major claim maps to at least one source.
- Consistency check: component names and interfaces are uniform across files.
- Ambiguity check: unresolved items documented with owner/question.
- Timeline integrity check: every significant document change has a corresponding timeline/revision entry.
- Sequencing check: each major file passed file-level gate before next file generation.
- Depth check: documents are review-ready and not outline-only.
- Publish outputs and summary.
- Write generated files to the dedicated output root.
- Produce a run summary with:
- Sources processed
- Source deltas (
added,updated,removed,unchangedcounts) - Extraction failures
- Conflicts found
- Documents generated
- Open questions
- Timeline entries added
- Include preserved existing docs count and updated docs count.
- Include per-file generation order and gate outcome summary.
- Persist current source and document snapshots under
.state/for the next incremental run.
Decision Points
- If sources are sparse or low quality: produce a minimal architecture baseline and expand open questions.
- If no established architecture is found: generate
architecture/Architecture_Options_Pros_Cons.mdand carry recommendation rationale into architecture docs. - If templates and playbooks conflict: prioritize templates for structure, playbooks for style/content depth, and record deviations.
- If multiple versions of the same spec exist: prefer latest approved version and cite discarded versions in traceability notes.
- If packaged playbooks are missing: use nearest equivalent packaged file and record selection rationale.
- If source signals conflict across time: prefer newer timestamped evidence unless superseded by formally approved artifacts.
- If a source is removed: do not erase prior decisions; mark status as
possibly obsoleteand add a review question.
Completion Criteria
- All required output artifacts are present.
- If no established architecture exists in sources,
architecture/Architecture_Options_Pros_Cons.mdis present with at least three options and a recommendation. - Every generated architecture section has either grounded content or explicit
TBDwith a question. - Open issues are consolidated in one place with source links.
- Architecture image prompts exist for all mandatory diagram families.
- A reviewer can trace major architectural decisions back to evidence.
- A dedicated output folder is used; source folders remain untouched.
- Old structure files remain available and are synchronized where equivalent outputs exist.
- Timeline files are updated for the run and remain chronologically consistent.
- A reviewer can understand what changed since the previous run without diffing raw files.
Invocation Pattern
When invoked, ask only for:
inputSourceFolder
Then:
- Auto-resolve templates/playbooks from packaged defaults.
- Auto-create missing template folders/files from packaged assets.
- Auto-create a dedicated output folder.
- Execute the workflow and report output paths plus unresolved questions.
Optional metadata (system name/domain/environment) may be inferred from source content if not provided.