Generate a complete software specification document for the current project/repo, including architecture, data model, key processes, pseudocode, and Mermaid diagrams (context, container/deployment, module relations, sequence, ER, class, flowchart, state).
When invoked, produce a single, comprehensive specification document for the current repository/project with all required sections:
Default output file: docs/specification.md
(If docs/ does not exist, create it. If user requests another path, follow it.)
Ask at most 5 clarifying questions only if the repo does not contain enough information to avoid unsafe guessing.
If information is missing, proceed with best-effort inference and add an “Assumptions & Open Questions” section near the top.
Do not invent details. If you cannot locate evidence in the repo, label as:
README*, docs/, architecture/, ADR*, design*, SPEC*.pyproject.toml, requirements.txt, go.mod, pom.xml, build.gradle, .csproj, package.json (server), Dockerfilepackage.json, pnpm-lock.yaml, yarn.lock, vite.config.*, next.config.*migrations/, prisma/schema.prisma, alembic/, db/schema.sql, knexfile.*models/, entities/, schema/docker-compose.yml, Dockerfile*, k8s/, helm/, .github/workflows/*, terraform/Version: {{date}}
Repo: {{repo identifier if known}}
Primary stack: {{inferred stack}}
Provide a table:
| Area | Choice | Evidence | Why this choice | Alternatives considered |
|---|
Provide a table:
| Entity/Table | Primary key | Key fields | Relationships | Notes |
|---|
List 3–7 “key processes” (system behaviors) using this structure:
For each key process, provide pseudocode:
Example format:
function ProcessName(input):
validate input
begin transaction (if needed)
...
return result