Skip to content

feat(integrations): generalize post-processing to all format types#3311

Open
rhuss wants to merge 1 commit into
github:mainfrom
rhuss:004-generalize-post-processing
Open

feat(integrations): generalize post-processing to all format types#3311
rhuss wants to merge 1 commit into
github:mainfrom
rhuss:004-generalize-post-processing

Conversation

@rhuss

@rhuss rhuss commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add post_process_command_content(self, content: str) -> str to IntegrationBase with no-op default
  • Call it from register_commands() for non-skills format types (Markdown, TOML, YAML)
  • Skills-format agents excluded (preserve existing post_process_skill_content() path)

This gives extension authors a clean per-agent content transformation seam for all 21 non-skills integrations that previously had no post-processing hook.

Ref: #3303 (the post_process_command_content() portion welcomed by maintainer)

Test plan

  • Default no-op returns content unchanged
  • Monkeypatched Markdown-format agent gets transformation applied
  • Skills-format agent (Claude) does NOT get post_process_command_content() called
  • Regression: plain template output identical for both agent types
  • Ruff passes on modified files

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 2, 2026 17:45

Copilot AI 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 introduces a new per-integration hook (post_process_command_content) so non-skills command outputs (Markdown/TOML/YAML) can be post-processed during CommandRegistrar.register_commands(), while preserving the existing skills-only post_process_skill_content() behavior.

Changes:

  • Add IntegrationBase.post_process_command_content(content) -> str with a no-op default.
  • Invoke post_process_command_content() from CommandRegistrar.register_commands() for non-skills outputs before writing to disk.
  • Add tests covering the no-op default, non-skills hook application, and skills exclusion (plus a large set of spec/brainstorm/.specify artifacts and updated ignore rules).

Reviewed changes

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

Show a summary per file
File Description
tests/test_post_process.py New tests for the post-processing hook behavior (non-skills applied, skills excluded, no-op default).
src/specify_cli/integrations/base.py Adds the post_process_command_content() hook to IntegrationBase.
src/specify_cli/agents.py Calls the new hook for non-skills command outputs during registration.
specs/004-generalize-post-processing/spec.md Feature spec describing the generalized post-processing hook.
specs/004-generalize-post-processing/checklists/requirements.md Requirements-quality checklist for the feature spec.
CLAUDE.md Adds an auto-generated development guidelines/context file.
brainstorm/02-script-based-hook-enforcement.md Brainstorm document about script-based hook enforcement.
brainstorm/02-generalize-post-processing.md Brainstorm document about the generalized post-processing hook.
brainstorm/01-extension-capability-system.md Brainstorm document for a broader capability system concept.
.specify/workflows/workflow-registry.json Adds workflow registry state/artifact under .specify/.
.specify/workflows/speckit/workflow.yml Adds a bundled workflow definition under .specify/.
.specify/templates/tasks-template.md Adds/updates tasks template under .specify/.
.specify/templates/spec-template.md Adds/updates spec template under .specify/.
.specify/templates/plan-template.md Adds/updates plan template under .specify/.
.specify/templates/constitution-template.md Adds/updates constitution template under .specify/.
.specify/templates/checklist-template.md Adds/updates checklist template under .specify/.
.specify/templates/agent-file-template.md Adds/updates agent-file template under .specify/.
.specify/sdd-traits.json Adds .specify traits state/artifact.
.specify/scripts/bash/setup-plan.sh Adds/updates a .specify bash script.
.specify/scripts/bash/check-prerequisites.sh Adds/updates a consolidated prerequisites script.
.specify/memory/constitution-bak.md Adds a backup constitution file under .specify/memory/.
.specify/integrations/speckit.manifest.json Adds .specify integration manifest artifact.
.specify/integrations/claude.manifest.json Adds .specify integration manifest artifact.
.specify/integration.json Adds .specify integration selection artifact.
.specify/init-options.json Adds .specify init-options artifact.
.specify/feature.json Adds .specify feature directory artifact.
.specify/extensions/spex/extension.yml Adds a spex extension definition under .specify/extensions/.
.specify/extensions/spex/commands/speckit.spex.spec-refactoring.md Adds a spex command template under .specify/extensions/.
.specify/extensions/spex/commands/speckit.spex.help.md Adds a spex command template under .specify/extensions/.
.specify/extensions/spex/commands/speckit.spex.flow-state.md Adds a spex command template under .specify/extensions/.
.specify/extensions/spex/commands/speckit.spex.extensions.md Adds a spex command template under .specify/extensions/.
.specify/extensions/spex/commands/speckit.spex.clear.md Adds a spex command template under .specify/extensions/.
.specify/extensions/spex-worktrees/extension.yml Adds a spex-worktrees extension definition under .specify/extensions/.
.specify/extensions/spex-teams/extension.yml Adds a spex-teams extension definition under .specify/extensions/.
.specify/extensions/spex-teams/config-template.yml Adds a spex-teams config template under .specify/extensions/.
.specify/extensions/spex-teams/commands/speckit.spex-teams.research.md Adds a spex-teams command template under .specify/extensions/.
.specify/extensions/spex-teams/commands/speckit.spex-teams.orchestrate.md Adds a spex-teams command template under .specify/extensions/.
.specify/extensions/spex-teams/commands/speckit.spex-teams.implement.md Adds a spex-teams command template under .specify/extensions/.
.specify/extensions/spex-gates/extension.yml Adds a spex-gates extension definition under .specify/extensions/.
.specify/extensions/spex-gates/commands/speckit.spex-gates.stamp.md Adds a spex-gates command template under .specify/extensions/.
.specify/extensions/spex-gates/commands/speckit.spex-gates.review-plan.md Adds a spex-gates command template under .specify/extensions/.
.specify/extensions/spex-detach/extension.yml Adds a spex-detach extension definition under .specify/extensions/.
.specify/extensions/spex-detach/config-template.yml Adds a spex-detach config template under .specify/extensions/.
.specify/extensions/spex-detach/commands/speckit.spex-detach.detach.md Adds a spex-detach command template under .specify/extensions/.
.specify/extensions/spex-deep-review/extension.yml Adds a spex-deep-review extension definition under .specify/extensions/.
.specify/extensions/spex-deep-review/config-template.yml Adds a spex-deep-review config template under .specify/extensions/.
.specify/extensions/spex-collab/templates/reviewers-template.md Adds a spex-collab template under .specify/extensions/.
.specify/extensions/spex-collab/extension.yml Adds a spex-collab extension definition under .specify/extensions/.
.specify/extensions/spex-collab/config-template.yml Adds a spex-collab config template under .specify/extensions/.
.specify/extensions/spex-collab/commands/speckit.spex-collab.revise.md Adds a spex-collab command template under .specify/extensions/.
.specify/extensions/spex-collab/commands/speckit.spex-collab.reviewers.md Adds a spex-collab command template under .specify/extensions/.
.specify/extensions/spex-collab/commands/speckit.spex-collab.reconcile.md Adds a spex-collab command template under .specify/extensions/.
.specify/extensions/spex-collab/commands/speckit.spex-collab.phase-split.md Adds a spex-collab command template under .specify/extensions/.
.specify/extensions/git/scripts/powershell/initialize-repo.ps1 Adds a git extension PowerShell script under .specify/extensions/.
.specify/extensions/git/scripts/powershell/git-common.ps1 Adds git extension PowerShell utilities under .specify/extensions/.
.specify/extensions/git/scripts/powershell/auto-commit.ps1 Adds a git extension PowerShell auto-commit script under .specify/extensions/.
.specify/extensions/git/scripts/bash/initialize-repo.sh Adds a git extension bash script under .specify/extensions/.
.specify/extensions/git/scripts/bash/git-common.sh Adds git extension bash utilities under .specify/extensions/.
.specify/extensions/git/scripts/bash/auto-commit.sh Adds a git extension bash auto-commit script under .specify/extensions/.
.specify/extensions/git/README.md Adds documentation for the git extension under .specify/extensions/.
.specify/extensions/git/git-config.yml Adds git extension configuration under .specify/extensions/.
.specify/extensions/git/extension.yml Adds a git extension definition under .specify/extensions/.
.specify/extensions/git/config-template.yml Adds a git extension config template under .specify/extensions/.
.specify/extensions/git/commands/speckit.git.validate.md Adds a git extension command template under .specify/extensions/.
.specify/extensions/git/commands/speckit.git.remote.md Adds a git extension command template under .specify/extensions/.
.specify/extensions/git/commands/speckit.git.initialize.md Adds a git extension command template under .specify/extensions/.
.specify/extensions/git/commands/speckit.git.feature.md Adds a git extension command template under .specify/extensions/.
.specify/extensions/git/commands/speckit.git.commit.md Adds a git extension command template under .specify/extensions/.
.specify/extensions/.registry Adds extensions registry state/artifact.
.specify/extensions/.cache/catalog.json Adds cached extension catalog artifact.
.specify/extensions/.cache/catalog-metadata.json Adds cached catalog metadata artifact.
.specify/extensions/.cache/catalog-ebf165086500aab1-metadata.json Adds cached community catalog metadata artifact.
.specify/extensions.yml Adds extensions configuration file artifact.
.specify/.spex-state Adds spex state artifact.
.gitignore Updates ignore rules (including ignoring brainstorm/ and broad .specify patterns).

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

Comment thread src/specify_cli/agents.py
Copilot AI review requested due to automatic review settings July 2, 2026 17:50
…ormat types

Add post_process_command_content(self, content: str) -> str to IntegrationBase
with a no-op default. Wire it into register_commands() for non-skills format
types (Markdown, TOML, YAML) after format rendering, before writing to disk.
Also applies to aliases rendered via the inject_name path (cline, forge).

Skills-format agents are excluded to preserve the existing
post_process_skill_content() path and avoid double-processing.

This gives extension authors a clean per-agent content transformation seam
for all 21 non-skills integrations that previously had no post-processing hook.

Ref: github#3303

Assisted-By: 🤖 Claude Code
@rhuss rhuss force-pushed the 004-generalize-post-processing branch from 5270a4f to 70d165e Compare July 2, 2026 17:52

Copilot AI 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 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread tests/test_post_process.py
Comment thread tests/test_post_process.py
Comment thread tests/test_post_process.py
Copilot AI review requested due to automatic review settings July 2, 2026 17:55

Copilot AI 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 3 out of 3 changed files in this pull request and generated no new comments.

@rhuss rhuss marked this pull request as ready for review July 2, 2026 18:19
@rhuss rhuss requested a review from mnriem as a code owner July 2, 2026 18:19
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.

2 participants