Skip to content

feat: brownfield awareness across product, roadmap, and architecture#137

Open
dustyo-O wants to merge 1 commit into
mainfrom
feat/brownfield-awareness
Open

feat: brownfield awareness across product, roadmap, and architecture#137
dustyo-O wants to merge 1 commit into
mainfrom
feat/brownfield-awareness

Conversation

@dustyo-O

@dustyo-O dustyo-O commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • /awos:product detects brownfield projects (source code indicators like src/, package.json, etc.) during Creation Mode, runs an Explore agent focused on purpose/audience/features, triages each finding with user (accept / correct / reject), writes accepted findings to context/product/brownfield.md
  • /awos:roadmap reads brownfield.md, runs a focused Explore for existing capabilities (passing prior findings via <existing_findings> to avoid duplicates), appends ## Capabilities section
  • /awos:architecture reads brownfield.md, runs a focused Explore for tech stack, appends ## Technology section
  • /awos:hire removes brownfield.md after onboarding — all knowledge is absorbed into product-definition.md, roadmap.md, architecture.md
  • 6 new lint tests covering the brownfield lifecycle (creation, appending, removal, dedup contract, triage UX)

Supersedes the approaches on feat/scan-command and feat/scan-embedded — no new files, no new commands, no new templates.

Design decisions

  • Creation Mode only: brownfield detection runs on first /awos:product run only. Re-running in Update Mode skips it intentionally — by then context/spec/ holds feature knowledge and brownfield.md would be redundant.
  • Split exploration: each command owns one domain (product → capabilities → technology) rather than one big scan, so findings are relevant to the command's interview.
  • Accumulated dedup: each Explore agent receives prior brownfield.md contents in <existing_findings> tags to avoid re-discovering the same things.

Test plan

  • npm test — 84/84 pass (6 new brownfield contract tests)
  • npx prettier . --check — clean
  • Manual: run /awos:product on a brownfield project, verify exploration + triage + brownfield.md creation
  • Manual: run /awos:roadmap after, verify it reads brownfield.md and explores capabilities without duplicating product findings
  • Manual: run /awos:architecture after, verify it reads brownfield.md and explores tech stack
  • Manual: run /awos:hire after, verify brownfield.md is deleted

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added automatic detection of existing codebases with knowledge reuse across product, roadmap, and architecture discovery workflows.
    • Implemented user confirmation workflow to accept, reject, or correct brownfield findings during onboarding.
  • Documentation

    • Updated architecture and quick-start guides to document brownfield auto-detection and discovery flows.
  • Tests

    • Added test coverage for brownfield awareness workflows across onboarding commands.

…commands

Detect existing codebases during onboarding and explore them before
the interactive interview. Each command owns a focused exploration
domain — product (purpose/audience/features), roadmap (existing
capabilities), architecture (tech stack) — and triages findings with
the user via accept/correct/reject. Accepted findings accumulate in
context/product/brownfield.md so downstream commands avoid duplicate
questions. /awos:hire removes the file after onboarding completes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a brownfield awareness pipeline to AWOS onboarding: /awos:product detects existing codebases, runs an Explore agent, and persists confirmed findings to context/product/brownfield.md; /awos:roadmap and /awos:architecture each extend that file with capability and technology findings; /awos:hire deletes it after absorption. Contract tests and docs are updated accordingly.

Changes

Brownfield Awareness Onboarding Flow

Layer / File(s) Summary
Brownfield detection and initial persistence
commands/product.md
Creation Mode gains a brownfield pre-check using an Explore agent; accepted/corrected findings are written to context/product/brownfield.md under ## Product, and subsequent interview questions are phrased as confirmations.
Roadmap and architecture brownfield integration
commands/roadmap.md, commands/architecture.md
Both commands read brownfield.md, embed prior findings in <existing_findings> for the Explore agent to collect only new results, confirm with the user, and append under ## Capabilities / ## Technology respectively; architecture also pre-fills the template and enforces section-by-section confirmation.
Hire cleanup and contract tests
commands/hire.md, tests/lint-prompts.test.js
hire.md adds Step 10 to delete context/product/brownfield.md after onboarding. New test cases assert heading contracts, <existing_findings> forwarding, cleanup language, and triage option presence across all four brownfield-aware commands.
Documentation
CLAUDE.md, README.md
CLAUDE.md expands the Document-Centric Workflow section with brownfield rehydration and triage flow descriptions; README.md updates the "Running on an existing codebase?" note with the auto-detection and discovery sequence.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

minor

Suggested reviewers

  • AlexanderMakarov
  • workshur

Poem

🐇 Hop, hop through the old codebase maze,
Brownfield detected through the morning haze!
/awos:product sniffs each stack and stack,
Writes the findings — no need to backtrack.
Then hire sweeps the trail so clean,
The tidiest onboard the rabbit's ever seen! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely summarizes the main feature: brownfield awareness is added across the three core product/roadmap/architecture commands during onboarding.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/brownfield-awareness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
commands/hire.md (1)

17-24: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Consider declaring brownfield.md as Optional Input for consistency.

Step 10 checks and deletes context/product/brownfield.md, but the file is not declared in the INPUTS & OUTPUTS section. While hire.md doesn't read the file's content (unlike roadmap.md and architecture.md), adding an Optional Input declaration would maintain consistency across all brownfield-aware commands and signal that this file is expected to exist before cleanup.
[minor_issue]

📋 Suggested addition to INPUTS & OUTPUTS
 - **Prerequisite Input:** `context/product/architecture.md` (The technology stack decisions).
 - **Optional Input:** The latest `technical-considerations.md` from the highest-numbered `context/spec/*/` directory.
+- **Optional Input:** `context/product/brownfield.md` (produced by `/awos:product` and extended by `/awos:roadmap` and `/awos:architecture`; deleted at the end of onboarding).
 - **Template File:** `.awos/templates/agent-template.md` (The agent file structure).
 - **Output:** New or updated agent files in `.claude/agents/`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands/hire.md` around lines 17 - 24, Add a declaration for
context/product/brownfield.md as an Optional Input in the INPUTS & OUTPUTS
section of hire.md for consistency. Even though hire.md does not read the
content of this file (unlike other commands), declaring it as an Optional Input
is important because Step 10 references and deletes the file. This maintains
consistency with other brownfield-aware commands and signals that the file is
expected to exist before cleanup operations occur.

Source: Learnings

commands/roadmap.md (1)

20-25: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add context/product/brownfield.md to INPUTS & OUTPUTS declarations.

All three commands that read or check the brownfield file should declare it in their INPUTS sections for contract completeness and clarity. Per the PR 130 learning and the pattern demonstrated in hire.md's "Optional Input" syntax (which hire.md currently uses for technical-considerations.md), missing declarations obscure the data flow.

  • commands/roadmap.md#L20-L25: Add - **Optional Input:** context/product/brownfield.md (produced by /awos:product). after the Prerequisite Input line.
  • commands/architecture.md#L17-L23: Add the same Optional Input declaration after Prerequisite Input 2.
  • commands/hire.md#L17-L24: Add - **Optional Input:** context/product/brownfield.md (produced and extended by /awos:product, /awos:roadmap, and /awos:architecture; deleted at the end of onboarding). as a new line.

[major_issue]

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands/roadmap.md` around lines 20 - 25, Add declarations for
context/product/brownfield.md to the INPUTS & OUTPUTS sections across three
files to properly document data flow and dependencies. In commands/roadmap.md
(lines 20-25), add an Optional Input declaration for
context/product/brownfield.md after the Prerequisite Input line. In
commands/architecture.md (lines 17-23), add the same Optional Input declaration
after Prerequisite Input 2. In commands/hire.md (lines 17-24), add an Optional
Input declaration for context/product/brownfield.md with expanded lifecycle
details. Use the "Optional Input" syntax format with parenthetical notes about
which commands produce or extend the file, following the pattern already
established in hire.md for technical-considerations.md.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@commands/hire.md`:
- Around line 17-24: Add a declaration for context/product/brownfield.md as an
Optional Input in the INPUTS & OUTPUTS section of hire.md for consistency. Even
though hire.md does not read the content of this file (unlike other commands),
declaring it as an Optional Input is important because Step 10 references and
deletes the file. This maintains consistency with other brownfield-aware
commands and signals that the file is expected to exist before cleanup
operations occur.

In `@commands/roadmap.md`:
- Around line 20-25: Add declarations for context/product/brownfield.md to the
INPUTS & OUTPUTS sections across three files to properly document data flow and
dependencies. In commands/roadmap.md (lines 20-25), add an Optional Input
declaration for context/product/brownfield.md after the Prerequisite Input line.
In commands/architecture.md (lines 17-23), add the same Optional Input
declaration after Prerequisite Input 2. In commands/hire.md (lines 17-24), add
an Optional Input declaration for context/product/brownfield.md with expanded
lifecycle details. Use the "Optional Input" syntax format with parenthetical
notes about which commands produce or extend the file, following the pattern
already established in hire.md for technical-considerations.md.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 438997d6-cf8b-4f35-934c-c4a9b9cbe1c9

📥 Commits

Reviewing files that changed from the base of the PR and between 1fbba1a and a001703.

📒 Files selected for processing (7)
  • CLAUDE.md
  • README.md
  • commands/architecture.md
  • commands/hire.md
  • commands/product.md
  • commands/roadmap.md
  • tests/lint-prompts.test.js

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant