Skip to content

feat: add summarize command for brownfield(existed) project analysis - #1102

Closed
Ray0907 wants to merge 11 commits into
github:mainfrom
Ray0907:001-add-summarize-command
Closed

feat: add summarize command for brownfield(existed) project analysis#1102
Ray0907 wants to merge 11 commits into
github:mainfrom
Ray0907:001-add-summarize-command

Conversation

@Ray0907

Copy link
Copy Markdown

Adds 'specify summarize' to analyze existing projects and generate
technology stack summaries, making it easier to onboard to unfamiliar
codebases or document project architecture.

 Adds 'specify summarize' to analyze existing projects and generate
technology stack summaries, making it easier to onboard to unfamiliar
codebases or document project architecture.
CopilotAI review requested due to automatic review settings November 2, 2025 04:43

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new summarize command to analyze existing codebases and generate comprehensive project summaries. The feature helps bootstrap spec-kit usage in brownfield/existing projects by automatically discovering technology stack, architecture patterns, and code conventions.

  • Added specify summarize CLI command for project analysis
  • Created bash script to detect languages, frameworks, and directory structures
  • Added template files for project summary generation and AI assistant guidance

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
FileDescription
src/specify_cli/__init__.pyImplements summarize CLI command with script detection, execution, and summary generation
scripts/bash/generate-project-summary.shBash script to detect project type, languages, config files, and directory structure
templates/commands/summarize.mdAI assistant template with detailed instructions for comprehensive project analysis
templates/project-summary-template.mdStandalone template showing expected project summary structure
README.mdDocumentation updates for the new summarize command and /speckit.summarize slash command

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/specify_cli/__init__.py Outdated
Comment threadtemplates/commands/summarize.md Outdated
Comment threadtemplates/project-summary-template.md Outdated
Comment threadsrc/specify_cli/__init__.py Outdated
Comment threadtemplates/commands/summarize.md Outdated
Ray0907and others added 2 commits November 2, 2025 12:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings November 2, 2025 04:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

src/specify_cli/init.py:1

  • The fallback logic creates possible_script_names by replacing '.ps1' with '.sh', but this will only work when Windows is the platform (when script_name ends with '.ps1'). On Unix systems, script_name already ends with '.sh', so the replace operation does nothing, creating duplicate entries. Consider a more explicit approach: possible_script_names = ['generate-project-summary.sh', 'generate-project-summary.ps1'] to ensure both scripts are checked on all platforms.
#!/usr/bin/env python3

src/specify_cli/init.py:1

  • The script_type variable is set in the script search loop (lines 1222-1225), but if no script is found, the code exits at line 1234 before reaching this point. However, if somehow script_type remains None after finding a script (e.g., if the file has an unexpected extension), this will raise an unclear error. The 'else' branch at line 1244 is unreachable given the current logic since script_type is always set when a script is found.
#!/usr/bin/env python3

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadscripts/bash/generate-project-summary.sh Outdated
Comment threadscripts/bash/generate-project-summary.sh Outdated
Comment threadtemplates/commands/summarize.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings November 2, 2025 05:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/specify_cli/__init__.py Outdated
Comment threadscripts/powershell/generate-project-summary.ps1 Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings November 2, 2025 05:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/specify_cli/__init__.py Outdated
Comment threadtemplates/project-summary-template.md Outdated
Comment threadtemplates/project-summary-template.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings November 2, 2025 05:33
Ray0907and others added 2 commits November 2, 2025 13:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadscripts/powershell/generate-project-summary.ps1
@johnml1135

Copy link
Copy Markdown

Has this been tested on anything substantial, such as +1M lines of code? In trying to manually spin summaries (sillsdev/FieldWorks#500) I found I had to do a fair amount to have copilot:

  • Not optimize and look at every file in a folder or project
  • Perform multiple passes over each folder or project so as to capture nuance
  • Scaffold the AI description of each project in a AI understandable format
  • Develop a plan for keeping the summaries up to date automatically
  • Keep poking the coding agent to work through the 62 major projects in the repository. It would do 10, and then quit as it said it would continue.

Feel free to look at the pull request above for inspiration. It is 2 million lines of c# and xml. I just have it drafted today I have not verified how well it works.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity (180 days total). If you believe this PR is still relevant, please reopen it or create a new PR.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Ray0907@johnml1135@mnriem