-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprompt.commit.yaml
More file actions
97 lines (83 loc) · 3.03 KB
/
prompt.commit.yaml
File metadata and controls
97 lines (83 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
$schema: .guides/schemas/prompt.schema.json
apiVersion: ops/v1
id: operation.commit-analyze-and-apply
title: Analyze Pending Changes, Generate and Apply Conventional Commit
persona: SystemIntegrator
category: operation
difficulty: easy
context: |
This prompt scans the current Git working directory for uncommitted changes,
analyzes the intent based on the files modified, generates a semantic commit
message following the Conventional Commits specification, applies the commit,
and records the action in a `.guides/operation/worklog`.
The message format must follow:
<type>(scope): short summary
Where:
- type = feat | fix | docs | refactor | chore | test | ci | perf
- scope = logical area changed (e.g., cli, web, schema, prompts, docs)
- summary = what was changed, in plain language (max 72 characters)
This prompt ensures traceability by creating a worklog, and avoids blind commits
by only proceeding if changes are detected and grouped semantically.
dependencies: []
output:
- file: .git/COMMIT_EDITMSG
language: text
rules:
- Must follow conventional commit format
- Must contain only a single line summary
- file: .guides/operation/worklog.commit.md
language: markdown
rules:
- Must describe what files were staged and committed
- Must include commit message used
- Must list prompt ID (if applicable)
- Must justify the type and scope selection based on file changes
steps:
- id: check-for-changes
title: Detect pending Git changes
actions:
- Run `git status --porcelain`
- If no changes found, abort prompt with message: "No staged or modified files to commit."
- id: group-files-by-scope
title: Group changed files into logical scopes
actions:
- Categorize changes by directory (e.g., src/commands → cli, src/web → web, .guides/prompts → prompts)
- If multiple scopes found, default to `multi` or dominant folder
- id: determine-commit-type
title: Infer commit type based on change content
actions:
- Analyze file types and patterns:
- New features → feat
- Bug fixes → fix
- Markdown/docs → docs
- Prompt updates → chore or docs
- Refactoring (no behavior change) → refactor
- id: generate-message
title: Generate conventional commit message
actions:
- Build the message as `<type>(<scope>): <summary>`
- Ensure it's ≤ 72 characters
- Save to `.git/COMMIT_EDITMSG`
- id: apply-commit
title: Stage and commit all changes
actions:
- Run `git add -A`
- Run `git commit -F .git/COMMIT_EDITMSG`
- id: write-worklog
title: Log commit reasoning and traceability
actions:
- Write `.guides/operation/worklog.commit.md` with:
- Commit message used
- Files affected
- Type and scope selected
- Why this message format was chosen
- Link to prompt ID if applicable
tags:
- commit
- git
- automation
- conventional-commits
- traceability
- operation
createdBy: user
version: 1