-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add feedback command and lessons.md integration for continuous improvement #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5c317de
4b86710
1a63270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -267,13 +267,23 @@ Additional commands for enhanced quality and validation: | |
| | `/speckit.clarify` | Clarify underspecified areas (recommended before `/speckit.plan`; formerly `/quizme`) | | ||
| | `/speckit.analyze` | Cross-artifact consistency & coverage analysis (run after `/speckit.tasks`, before `/speckit.implement`) | | ||
| | `/speckit.checklist` | Generate custom quality checklists that validate requirements completeness, clarity, and consistency (like "unit tests for English") | | ||
| | `/speckit.feedback` | Extract and store lessons learned from PR review comments for future reference | | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| | Variable | Description | | ||
| | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| | `SPECIFY_FEATURE` | Override feature detection for non-Git repositories. Set to the feature directory name (e.g., `001-photo-albums`) to work on a specific feature when not using Git branches.<br/>\*\*Must be set in the context of the agent you're working with prior to using `/speckit.plan` or follow-up commands. | | ||
|
|
||
| ### Lessons Learned | ||
|
|
||
| Spec-kit implements a continuous improvement system that captures lessons from PR reviews and applies them to future development work. The `/speckit.feedback` command extracts insights from code review comments and stores them in two places: | ||
|
|
||
| - **`memory/lessons.md`** - Central lessons database organized by category (architecture, code-quality, testing, security, performance, documentation) | ||
| - **`memory/feedback/pr-<number>-lessons.md`** - Per-PR detailed feedback summaries that preserve the full context of each review | ||
|
|
||
| When you run `/speckit.specify`, `/speckit.plan`, or `/speckit.implement`, these commands automatically load relevant lessons from the central database for their phase and apply them proactively. This creates a compounding knowledge effect where your team's collective wisdom from past reviews continuously improves future implementations, helping avoid repeated mistakes and reinforcing best practices without manual intervention. | ||
|
Comment on lines
+278
to
+285
|
||
|
|
||
| ## π Core Philosophy | ||
|
|
||
| Spec-Driven Development is a structured process that emphasizes: | ||
|
|
@@ -401,7 +411,7 @@ The first step should be establishing your project's governing principles using | |
| /speckit.constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements. Include governance for how these principles should guide technical decisions and implementation choices. | ||
| ``` | ||
|
|
||
| This step creates or updates the `.specify/memory/constitution.md` file with your project's foundational guidelines that the AI agent will reference during specification, planning, and implementation phases. | ||
| This step creates or updates the `memory/constitution.md` file with your project's foundational guidelines that the AI agent will reference during specification, planning, and implementation phases. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π§© Analysis chainπ Script executed: cd . && wc -l README.mdRepository: buddhisthead/spec-kit Length of output: 78 π Script executed: # Read the relevant sections of README.md
sed -n '410,420p' README.mdRepository: buddhisthead/spec-kit Length of output: 797 π Script executed: # Read the directory tree section
sed -n '458,474p' README.mdRepository: buddhisthead/spec-kit Length of output: 458 π Script executed: # Search for any references to constitution.md in the repository
rg 'constitution\.md' -B 2 -A 2Repository: buddhisthead/spec-kit Length of output: 8908 π Script executed: # Search for .specify directory references
rg '\.specify' README.mdRepository: buddhisthead/spec-kit Length of output: 1441 Clarify the constitution file path to match the directory structure. Line 414 references the path as π€ Prompt for AI Agents |
||
|
|
||
| ### **STEP 2:** Create project specifications | ||
|
|
||
|
|
@@ -431,6 +441,11 @@ see yours. You can edit any comments that you make, but you can't edit comments | |
| delete any comments that you made, but you can't delete comments anybody else made. | ||
| ``` | ||
|
|
||
| You can mention a number of issue in your description and it will be used to generate the branch number, such as | ||
| ```text | ||
| For GH issue #123, Develop BugZapper, a new fuzzy test framework". | ||
| ``` | ||
|
|
||
| After this prompt is entered, you should see Claude Code kick off the planning and spec drafting process. Claude Code will also trigger some of the built-in scripts to set up the repository. | ||
|
|
||
| Once this step is completed, you should have a new branch created (e.g., `001-create-taskify`), as well as a new specification in the `specs/001-create-taskify` directory. | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,220 @@ | ||||||
| #!/usr/bin/env bash | ||||||
| # | ||||||
| # fetch-pr-feedback.sh - Extract PR data for the speckit.feedback agent | ||||||
| # | ||||||
| # Usage: | ||||||
| # ./fetch-pr-feedback.sh <pr_number> | ||||||
| # ./fetch-pr-feedback.sh --find-current # Find open PR for current branch (preferred) | ||||||
| # ./fetch-pr-feedback.sh --find-recent # Find most recently merged PR | ||||||
| # | ||||||
| # Output: JSON with PR metadata, review comments, and discussion comments | ||||||
| # | ||||||
|
|
||||||
| set -euo pipefail | ||||||
|
|
||||||
| # Colors for output | ||||||
| RED='\033[0;31m' | ||||||
| GREEN='\033[0;32m' | ||||||
| YELLOW='\033[1;33m' | ||||||
| NC='\033[0m' # No Color | ||||||
|
|
||||||
| error() { | ||||||
| echo -e "${RED}ERROR: $1${NC}" >&2 | ||||||
| exit 1 | ||||||
| } | ||||||
|
|
||||||
| warn() { | ||||||
| echo -e "${YELLOW}WARNING: $1${NC}" >&2 | ||||||
| } | ||||||
|
|
||||||
| info() { | ||||||
| echo -e "${GREEN}$1${NC}" >&2 | ||||||
| } | ||||||
|
|
||||||
| # Check for gh CLI | ||||||
| command -v gh >/dev/null 2>&1 || error "GitHub CLI (gh) is required but not installed." | ||||||
|
|
||||||
| # Check for jq | ||||||
| command -v jq >/dev/null 2>&1 || error "jq is required but not installed. Install with: brew install jq" | ||||||
|
|
||||||
| # Verify authentication | ||||||
| gh auth status >/dev/null 2>&1 || error "Not authenticated with GitHub. Run 'gh auth login' first." | ||||||
|
|
||||||
| # Get repository info | ||||||
| get_repo_info() { | ||||||
| gh repo view --json owner,name -q '"\(.owner.login)/\(.name)"' 2>/dev/null || error "Not in a GitHub repository." | ||||||
|
||||||
| gh repo view --json owner,name -q '"\(.owner.login)/\(.name)"' 2>/dev/null || error "Not in a GitHub repository." | |
| gh repo view --json owner,name -q '.owner.login + "/" + .name' 2>/dev/null || error "Not in a GitHub repository." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include the βotherβ category in the list.
Line 282 lists categories but omits
other, which is supported in the feedback template.Suggested fix
π Committable suggestion
π€ Prompt for AI Agents