Skip to content

feat(AI-82): port chapter generation prompts into SKILL.md Step 3#26

Merged
dastratakos merged 1 commit into
mainfrom
dean/ai-82-issue-15-port-chapter-generation-prompts-into-skillmd-step-3
May 4, 2026
Merged

feat(AI-82): port chapter generation prompts into SKILL.md Step 3#26
dastratakos merged 1 commit into
mainfrom
dean/ai-82-issue-15-port-chapter-generation-prompts-into-skillmd-step-3

Conversation

@dastratakos

@dastratakos dastratakos commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace the Step 3 TODO in skills/stage-chapters/SKILL.md with the full chapter generation prompt, ported from the Stage monorepo's analysis-agent.ts and narrative-agent.ts system prompts. After this change, an agent following the skill produces real Stage-quality chapters with clustering, narration, and key-change extraction in a single pass.

Changes

  • 3a Clustering rules: causal grouping, multi-file chapters, moves/refactors as single chapters, foundation-first ordering, hunk ordering within chapters
  • 3b Self-validation rules: every hunk in exactly one chapter, identified by exact (filePath, oldStart) from @@ headers
  • 3c Narration rules: action-oriented titles (max 8 words), 2–3 sentence impact-first summaries with causal links, markdown formatting
  • 3d Key change rules: judgment-call questions only, empty array when nothing needs human input, tight lineRefs with OLD/NEW column guidance, all good/bad examples from narrative-agent.ts
  • 3e Output format: chapter object shape matching ChaptersFileSchema

Testing

  • Verified all rule categories from the acceptance criteria are present (clustering, self-validation, narration, key changes, output format)
  • Confirmed output shape aligns with ChaptersFileSchema in packages/cli/src/schema.ts and hunkReferenceSchema/lineRefSchema in packages/types/src/chapters.ts

Open in Stage

Replace the Step 3 TODO with the full chapter clustering, narration,
and key-change-extraction prompt ported from the Stage monorepo's
analysis-agent.ts and narrative-agent.ts system prompts.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request replaces a placeholder in SKILL.md with comprehensive instructions for clustering and narrating code changes into 'chapters,' defining rules for grouping hunks, narration style, and identifying key changes. A review comment suggests ensuring the output format uses standard JSON instead of jsonc to avoid parsing errors if comments are included in the generated output.

Comment thread skills/stage-chapters/SKILL.md
@dastratakos dastratakos marked this pull request as ready for review May 4, 2026 16:33
@dastratakos dastratakos merged commit db6d700 into main May 4, 2026
5 checks passed
@dastratakos dastratakos deleted the dean/ai-82-issue-15-port-chapter-generation-prompts-into-skillmd-step-3 branch May 4, 2026 16:33
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