Detect tech stack (language, framework, database)
Detect structure (monolith, monorepo)
Infer coding patterns
<monorepo_detection>
Check for monorepo indicators:
- nx.json, turbo.json, pnpm-workspace.yaml, lerna.json, rush.json
- package.json with "workspaces" field
- Cargo.toml with [workspace] section
- go.work file
- Multiple independent package/dependency manifests
- Common patterns: packages/*, apps/*, services/*, libs/*
If any indicator found → workspace.structure = "monorepo"
</monorepo_detection>
<output>
Here's what I found:
**Tech Stack**: {detected_tech}
**Structure**: {detected_structure}
**Patterns**: {detected_patterns}
Does this look accurate? [Y/n/edit]
</output>
<action>Find module directories by exploring:</action>
<substep>Paths from workspace config (nx.json projects, pnpm-workspace.yaml, etc.)</substep>
<substep>Common patterns: packages/*, apps/*, services/*, libs/*, modules/*</substep>
<substep>Directories with their own dependency manifest</substep>
<action>For each discovered module, analyze (AI-driven, no hardcoded mappings):</action>
<substep>Primary language (from file extensions, config files)</substep>
<substep>Build/test commands (from CI config, package scripts, Makefile)</substep>
<substep>Linter/formatter (from config files in module)</substep>
<substep>Package manager (from lock files, manifests)</substep>
<output>
Found {{module_count}} modules:
| Module | Language | Test Command | Linter |
|--------|----------|--------------|--------|
{{#each modules}}
| {{path}} | {{language}} | {{test_cmd}} | {{linter}} |
{{/each}}
Create module-specific standards?
[c] All modules — create standards for all
[s] Select — choose which modules
[n] None — I'll create them manually later
</output>
<check if="response == c or response == s">
<action>For each selected module, create {module}/.specs-fire/standards/tech-stack.md</action>
<note>Only tech-stack.md by default — other standards inherit from root</note>
</check>