@@ -108,60 +108,13 @@ def _build_sdd_prompt(
108108 else :
109109 issue_block = f"Issue / task description:\n { arg } "
110110
111- prompt = f"""You are running a SDD pre-analysis on the repo at { working_dir } .
111+ return f"""SKILL: Load `.claude/skills/sdd.md` before starting .
112112
113- Protected branches (NEVER push to these): { protected_str }
113+ Working directory: { working_dir }
114+ Protected branches (never push to these): { protected_str }
114115
115116{ issue_block }
116-
117- Instructions:
118- 1. If a GitHub URL was provided, run: gh issue view { arg if is_url else '<url>' } to fetch the issue title and body.
119-
120- 2. Infer branch type from the issue/description content:
121- - Bug report, crash, error, regression → Fix → base branch: main
122- - New feature, enhancement, improvement → Feat → base branch: develop
123- - Refactoring, cleanup → Refactor → base branch: develop
124- - Documentation → Docs → base branch: develop
125- - Everything else → Chore → base branch: develop
126- If the repo does not have a "develop" branch, use "main" as the base for everything.
127-
128- 3. Determine the base branch:
129- Run: git branch -r
130- Use the branching rule above. If the required base branch does not exist remotely, fall back to main.
131-
132- 4. Create a new branch from the correct base:
133- Run: git fetch origin
134- Run: git checkout -b <branch-name> origin/<base-branch>
135- Branch naming:
136- - Numbered issues: {{Type}}/Issue{{N}}{{DescriptionInPascalCase}} (e.g. Feat/Issue5AddDarkMode)
137- - Free-text input: {{Type}}/{{DescriptionInPascalCase}} (e.g. Fix/LoginCrashOnExpiredToken)
138-
139- 5. Explore the repo structure — focus on directories relevant to the issue.
140-
141- 6. Determine the output directory for this analysis using the branch name from step 4.
142- The branch name (e.g. "Feat/Issue5AddDarkMode") maps directly to a subdirectory:
143- - Branch "Feat/Issue5AddDarkMode" → .agent/Feat/Issue5AddDarkMode/
144- - Branch "Fix/LoginCrashOnExpiredToken" → .agent/Fix/LoginCrashOnExpiredToken/
145- Use this directory for ALL files in steps 7-9. Never write to a generic .agent/planning/ or .agent/context/.
146-
147- 7. Write .agent/<Type>/<BranchSlug>/planning.md — what to implement, acceptance criteria.
148- 8. Write .agent/<Type>/<BranchSlug>/files.md — relevant files and their role.
149- 9. Write .agent/<Type>/<BranchSlug>/approach.md — suggested approach, alternatives, tradeoffs.
150- 10. Run: git add .agent/ && git commit -m "📝 docs(analysis): agregar pre-análisis { arg [:60 ] if not is_url else 'issue #' + str (_extract_issue_number (arg ) or '?' )} "
151- 11. Run: git push origin <branch-name>
152- 12. RESTRICTIONS:
153- - DO NOT modify any existing source file outside .agent/
154- - DO NOT open a Pull Request
155- - DO NOT run tests or builds
156- - DO NOT push to any protected branch ({ protected_str } )
157-
158- End with a brief summary containing:
159- - Branch name created and base branch used
160- - Directory created under .agent/ (full path)
161- - Files written
162- - One-line problem statement
163117"""
164- return prompt
165118
166119
167120async def sdd_command (update : Update , context : ContextTypes .DEFAULT_TYPE ) -> None :
0 commit comments