Skip to content

feat(#175): Add title/body content analysis for phase detection - #226

Merged
admarble merged 3 commits into
mainfrom
feature/175-feat-spec-add-title-body-content-analysis-for-phas
Feb 1, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/175-feat-spec-add-title-body-content-analysis-for-phas

Conversation

@admarble

@admarble admarble commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements content analysis for /spec to supplement label-based phase detection
  • Adds solve comment detection to reuse /solve recommendations when available
  • Creates 3 new TypeScript modules with comprehensive test coverage (92 tests)

Changes

New Files

  • src/lib/content-analyzer.ts - Analyzes title keywords and body patterns for phase signals
  • src/lib/phase-signal.ts - Types and merging logic with priority (Labels > Solve > Title > Body)
  • src/lib/solve-comment-parser.ts - Detects and parses /solve output from issue comments

Modified Files

  • templates/skills/spec/SKILL.md - Added Content Analysis section (AC-1 through AC-4)

Acceptance Criteria Coverage

AC Description Status
AC-1 Spec analyzes issue title for phase-relevant keywords ✅ Implemented
AC-2 Spec analyzes issue body for phase-relevant patterns ✅ Implemented
AC-3 Content analysis supplements (not replaces) label detection ✅ Implemented
AC-4 If solve comment exists, use that instead of re-analyzing ✅ Implemented

Detection Patterns

Title Keywords:

Pattern Detection Suggested Phase
extract, component, refactor.*ui UI work Add /test
auth, permission, security Security-sensitive Add /security-review
refactor, migration, breaking Complex work Enable quality loop

Body Patterns:

Pattern Detection Suggested Phase
References .tsx files UI work likely Add /test
References auth/ directory Security-sensitive Add /security-review
Contains "breaking change" Complex work Enable quality loop

Test plan

  • Run npm test - 92 new tests pass (content-analyzer, phase-signal, solve-comment-parser)
  • Run npm run build - TypeScript compilation succeeds
  • Manual: Run /spec on an issue with UI keywords and verify content analysis output

Closes #175

🤖 Generated with Claude Code

Implements content analysis for the /spec skill to supplement label-based
phase detection. When /solve comment exists, uses that instead of re-analyzing.

- Add content-analyzer.ts: Analyzes title keywords and body patterns
  - Detects UI work (extract, component, .tsx files) → /test phase
  - Detects security-sensitive (auth, permission) → /security-review
  - Detects complex work (refactor, breaking change) → quality loop
- Add phase-signal.ts: Types and merging logic with priority
  - Priority: Labels > Solve > Title > Body
  - Signals can only ADD phases, never remove them
- Add solve-comment-parser.ts: Detects /solve output in comments
  - If solve comment exists, uses its recommendations (AC-4)
- Update spec SKILL.md with content analysis integration
  - New section for content analysis (AC-1, AC-2, AC-3, AC-4)
  - Updated output verification checklist
- Add comprehensive unit tests (92 tests passing)

Closes #175

Co-Authored-By: Claude Opus 4.5 <[email protected]>
admarble and others added 2 commits February 1, 2026 01:54
Makes the new content analysis library available for programmatic use:
- analyzeContentForPhases, analyzeTitleForPhases, analyzeBodyForPhases
- mergePhaseSignals, signalsFromLabels, signalFromLabel
- findSolveComment, parseSolveWorkflow, solveWorkflowToSignals

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Documents the new /spec content analysis capability:
- Title/body keyword and pattern detection
- Signal priority merging (Labels > Solve > Title > Body)
- Solve comment detection
- Library exports and 92 unit tests

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble merged commit 489ef86 into main Feb 1, 2026
6 checks passed
@admarble
admarble deleted the feature/175-feat-spec-add-title-body-content-analysis-for-phas branch February 1, 2026 08:06
admarble added a commit that referenced this pull request Sep 10, 2026
…stranded exec work (#1032) (#1034)

* fix(exec): block background tasks under the orchestrator; WIP-commit stranded exec work (#1032)

Every stranded-exec transcript found (ad-motion #226/#233, sequant #933/#990,
the vid-gen bench) ended with the agent starting the test suite as a Monitor or
a backgrounded Bash command and then "waiting for the notification". Under
sequant run the phase ends when the turn ends, no notification is ever
delivered, and the #879 guard fails the phase with the work uncommitted.

- pre-tool.sh: with SEQUANT_ORCHESTRATOR set, HOOK_BLOCK a Monitor tool call
  and a Bash call with run_in_background: true, pointing at the foreground
  form (`timeout 600 npm test ...`). Interactive sessions untouched.
- /exec §3: foreground-only rule for the suite, after a WIP commit.
- phase-executor: when the exec tree is `uncommitted`, commit the dirty paths
  as `wip(#N): exec ended with uncommitted work (auto-committed by sequant)`
  before failing the phase; the error names the commit. Git errors fall back
  to the pre-#1032 message and leave the work in place.
- Tests: hook integration (AC-1/AC-2), skill gate (AC-3), real-git WIP commit
  (AC-4/AC-5).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR

* fix(exec): conventional type for the WIP checkpoint; update the #879 AC-3 test to the #1032 contract

The pre-tool hook (and commitlint setups downstream) reject `wip` as a commit
type, so the auto-commit and the /exec skill example now use
`chore(#N): wip checkpoint — …`. The #879 AC-3 integration case asserted the
guard mutates nothing; it now asserts the dirty file is byte-identical AND
checkpointed on the branch, which is the new contract.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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.

feat(spec): Add title/body content analysis for phase detection

1 participant