ai-core-framework 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +21 -0
- package/.codex-plugin/plugin.json +35 -0
- package/.cursor-plugin/plugin.json +22 -0
- package/README.md +173 -0
- package/bin/ai-core-framework.js +110 -0
- package/core/README.md +162 -0
- package/core/agents/README.md +32 -0
- package/core/agents/business-analyst.md +269 -0
- package/core/agents/developer.md +375 -0
- package/core/agents/qa-tester.md +477 -0
- package/core/agents/scrum-master.md +136 -0
- package/core/agents/tech-lead.md +345 -0
- package/core/config/backlog.schema.json +38 -0
- package/core/config/docs-policy.default.json +37 -0
- package/core/config/release.schema.json +120 -0
- package/core/config/ticket.schema.json +253 -0
- package/core/rules/00-global-rules.md +373 -0
- package/core/rules/01-git-workflow.md +388 -0
- package/core/rules/02-code-quality.md +77 -0
- package/core/rules/03-security.md +78 -0
- package/core/rules/04-documentation.md +72 -0
- package/core/rules/05-testing-mandatory.md +374 -0
- package/core/rules/06-approval-gates.md +388 -0
- package/core/rules/07-definition-of-ready.md +112 -0
- package/core/rules/08-definition-of-done.md +149 -0
- package/core/scripts/ai-core.sh +456 -0
- package/core/scripts/generate-views.sh +210 -0
- package/core/scripts/install-codex-prompts.sh +127 -0
- package/core/scripts/log-user-request.sh +113 -0
- package/core/scripts/setup-project.sh +183 -0
- package/core/scripts/sync-platforms.sh +322 -0
- package/core/scripts/validate-audit-log.sh +73 -0
- package/core/scripts/validate-docs.sh +365 -0
- package/core/scripts/validate-permissions.sh +132 -0
- package/core/scripts/validate-state.sh +611 -0
- package/core/scripts/workflow.sh +513 -0
- package/core/skills/README.md +21 -0
- package/core/skills/ai-core-commands/SKILL.md +86 -0
- package/core/skills/brainstorming/SKILL.md +40 -0
- package/core/skills/development-implement-task/SKILL.md +308 -0
- package/core/skills/executing-ticket/SKILL.md +28 -0
- package/core/skills/git-branch-status/SKILL.md +56 -0
- package/core/skills/git-cleanup-branches/SKILL.md +57 -0
- package/core/skills/git-scan-untracked/SKILL.md +50 -0
- package/core/skills/meta-generate-views/SKILL.md +54 -0
- package/core/skills/meta-request-log/SKILL.md +61 -0
- package/core/skills/meta-sprint-report/SKILL.md +59 -0
- package/core/skills/meta-sync-platforms/SKILL.md +53 -0
- package/core/skills/meta-ticket-health/SKILL.md +61 -0
- package/core/skills/meta-validate-audit-log/SKILL.md +42 -0
- package/core/skills/meta-validate-docs/SKILL.md +58 -0
- package/core/skills/meta-validate-permissions/SKILL.md +53 -0
- package/core/skills/meta-validate-state/SKILL.md +58 -0
- package/core/skills/planning-analyze-requirements/SKILL.md +471 -0
- package/core/skills/planning-backlog-status/SKILL.md +57 -0
- package/core/skills/planning-document-existing-requirements/SKILL.md +246 -0
- package/core/skills/planning-estimate-task/SKILL.md +60 -0
- package/core/skills/planning-groom-ticket/SKILL.md +442 -0
- package/core/skills/planning-mark-ready/SKILL.md +111 -0
- package/core/skills/planning-plan-refactor/SKILL.md +66 -0
- package/core/skills/planning-plan-sprint/SKILL.md +112 -0
- package/core/skills/planning-prioritize-backlog/SKILL.md +62 -0
- package/core/skills/planning-write-plan/SKILL.md +68 -0
- package/core/skills/project-detect-stack/SKILL.md +71 -0
- package/core/skills/project-discover-codebase/SKILL.md +74 -0
- package/core/skills/project-setup-project/SKILL.md +113 -0
- package/core/skills/qa-bug-status/SKILL.md +52 -0
- package/core/skills/qa-report-bug/SKILL.md +518 -0
- package/core/skills/qa-smoke-test/SKILL.md +387 -0
- package/core/skills/qa-triage-bug/SKILL.md +62 -0
- package/core/skills/qa-verify-fix/SKILL.md +446 -0
- package/core/skills/release-hotfix/SKILL.md +117 -0
- package/core/skills/release-release/SKILL.md +123 -0
- package/core/skills/release-rollback/SKILL.md +62 -0
- package/core/skills/review-create-pr/SKILL.md +418 -0
- package/core/skills/review-merge-pr/SKILL.md +425 -0
- package/core/skills/review-techlead-review/SKILL.md +547 -0
- package/core/skills/using-ai-core/SKILL.md +72 -0
- package/core/skills/verification-before-done/SKILL.md +35 -0
- package/core/skills/writing-implementation-plan/SKILL.md +45 -0
- package/core/templates/ci/ai-core-governance.yml +112 -0
- package/core/templates/ci/node-pnpm.yml +35 -0
- package/core/templates/pm/retrospective-template.md +47 -0
- package/core/templates/pm/sprint-plan-template.md +45 -0
- package/core/templates/pr/pull-request-template.md +247 -0
- package/core/templates/project/CODEOWNERS +11 -0
- package/core/templates/project/docs-policy.json +3 -0
- package/core/templates/project/project-config.yaml +137 -0
- package/core/templates/project/project-structure.yaml +76 -0
- package/core/templates/qa/bug-report-template.md +371 -0
- package/core/templates/qa/test-plan-template.md +57 -0
- package/core/templates/release/release-record-template.json +67 -0
- package/core/templates/requirements/PRD-template.md +58 -0
- package/core/templates/requirements/user-story-template.md +381 -0
- package/core/templates/technical/ADR-template.md +46 -0
- package/core/templates/technical/refactor-plan-template.md +84 -0
- package/core/templates/technical/tech-design-template.md +71 -0
- package/core/workflows/bug-lifecycle.md +56 -0
- package/core/workflows/feature-lifecycle.md +347 -0
- package/core/workflows/hotfix-lifecycle.md +65 -0
- package/core/workflows/sprint-lifecycle.md +56 -0
- package/lib/install-codex.js +85 -0
- package/package.json +36 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: planning-document-existing-requirements
|
|
3
|
+
description: Use when the user asks to run /document-existing-requirements, document requirements for an existing feature, infer current behavior from code, or create requirements docs from an implemented module.
|
|
4
|
+
command: /document-existing-requirements
|
|
5
|
+
display_name: "Document Existing Requirements"
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
owner_agent: business-analyst
|
|
8
|
+
requires_agents:
|
|
9
|
+
- business-analyst
|
|
10
|
+
consults_agents:
|
|
11
|
+
- tech-lead
|
|
12
|
+
- developer
|
|
13
|
+
model_preference: opus
|
|
14
|
+
args:
|
|
15
|
+
- name: scope
|
|
16
|
+
required: true
|
|
17
|
+
type: string
|
|
18
|
+
description: "Existing feature/module/path to analyze, for example auth, billing, src/app/login"
|
|
19
|
+
- name: output_path
|
|
20
|
+
required: false
|
|
21
|
+
type: string
|
|
22
|
+
default: "docs/project/requirements/<scope>-requirements.md"
|
|
23
|
+
description: "Requirement documentation path"
|
|
24
|
+
- name: create_tickets
|
|
25
|
+
required: false
|
|
26
|
+
type: boolean
|
|
27
|
+
default: false
|
|
28
|
+
description: "Whether to create follow-up tickets for discovered gaps"
|
|
29
|
+
preconditions:
|
|
30
|
+
- ai_core_initialized: true
|
|
31
|
+
- source_code_available: true
|
|
32
|
+
- business_analyst_agent_available: true
|
|
33
|
+
postconditions:
|
|
34
|
+
- requirements_doc_created: true
|
|
35
|
+
- evidence_links_included: true
|
|
36
|
+
- inferred_requirements_marked: true
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
# /document-existing-requirements
|
|
40
|
+
|
|
41
|
+
> Analyze existing source code and write requirement documentation for behavior that already exists.
|
|
42
|
+
> This command is for reverse-documenting current product behavior, not inventing new requirements.
|
|
43
|
+
|
|
44
|
+
## 🎯 Purpose
|
|
45
|
+
|
|
46
|
+
Create a requirements document from existing implementation evidence:
|
|
47
|
+
- Current user-facing behavior
|
|
48
|
+
- Personas and user goals visible from code
|
|
49
|
+
- Acceptance Criteria derived from routes, UI, tests, validators, and error handling
|
|
50
|
+
- Business rules implemented in source code
|
|
51
|
+
- Edge cases and constraints already enforced
|
|
52
|
+
- Documentation gaps, ambiguity, and follow-up questions
|
|
53
|
+
|
|
54
|
+
## 🚦 Trigger
|
|
55
|
+
|
|
56
|
+
**Manual**:
|
|
57
|
+
```text
|
|
58
|
+
/document-existing-requirements auth
|
|
59
|
+
/document-existing-requirements src/app/login
|
|
60
|
+
/document-existing-requirements --output_path=docs/project/requirements/auth-requirements.md auth
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 📋 Preconditions (STRICT)
|
|
64
|
+
|
|
65
|
+
Check before starting. **ABORT** if any check fails.
|
|
66
|
+
|
|
67
|
+
### 1. Source code exists
|
|
68
|
+
At least one implementation path must exist under `src/`, `app/`, `lib/`, or the project-specific source root.
|
|
69
|
+
|
|
70
|
+
### 2. Scope is explicit
|
|
71
|
+
`scope` **MUST** identify a feature, module, route, or path. Vague scopes such as "the app" are **FORBIDDEN** unless the repository is very small.
|
|
72
|
+
|
|
73
|
+
### 3. Output path is allowed
|
|
74
|
+
Output **MUST** be written under `docs/project/requirements/` unless the user explicitly provides another documentation path allowed by project rules.
|
|
75
|
+
|
|
76
|
+
## 🔄 Execution Flow (STRICT ORDER)
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
┌──────────────────────────────────────────────────────────┐
|
|
80
|
+
│ STEP 1: Resolve scope │
|
|
81
|
+
│ - Map scope to files, routes, components, tests │
|
|
82
|
+
│ - Identify entrypoints and user-facing surfaces │
|
|
83
|
+
├──────────────────────────────────────────────────────────┤
|
|
84
|
+
│ STEP 2: Gather evidence │
|
|
85
|
+
│ - Read implementation files │
|
|
86
|
+
│ - Read tests and fixtures │
|
|
87
|
+
│ - Read API route handlers and validators │
|
|
88
|
+
│ - Read UI copy, forms, states, and error messages │
|
|
89
|
+
│ - Read existing docs/ADRs when relevant │
|
|
90
|
+
├──────────────────────────────────────────────────────────┤
|
|
91
|
+
│ STEP 3: Extract observed behavior │
|
|
92
|
+
│ - List capabilities proven by code │
|
|
93
|
+
│ - List inputs, outputs, states, permissions │
|
|
94
|
+
│ - List validation, errors, limits, and side effects │
|
|
95
|
+
├──────────────────────────────────────────────────────────┤
|
|
96
|
+
│ STEP 4: Derive requirements │
|
|
97
|
+
│ - Convert observed behavior into User Stories │
|
|
98
|
+
│ - Convert branches/tests/errors into AC scenarios │
|
|
99
|
+
│ - Mark each requirement as OBSERVED or INFERRED │
|
|
100
|
+
├──────────────────────────────────────────────────────────┤
|
|
101
|
+
│ STEP 5: Identify gaps │
|
|
102
|
+
│ - Missing tests │
|
|
103
|
+
│ - Unclear behavior │
|
|
104
|
+
│ - Inconsistent UI/API behavior │
|
|
105
|
+
│ - Business rules implemented but undocumented │
|
|
106
|
+
├──────────────────────────────────────────────────────────┤
|
|
107
|
+
│ STEP 6: Write requirements document │
|
|
108
|
+
│ - Path: docs/project/requirements/<scope>-requirements.md │
|
|
109
|
+
│ - Include evidence links for every observed claim │
|
|
110
|
+
│ - Include open questions │
|
|
111
|
+
├──────────────────────────────────────────────────────────┤
|
|
112
|
+
│ STEP 7: Optional follow-up tickets │
|
|
113
|
+
│ - Only if create_tickets=true │
|
|
114
|
+
│ - Create tickets for gaps, missing tests, ambiguities │
|
|
115
|
+
└──────────────────────────────────────────────────────────┘
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 🔒 Hard Rules
|
|
119
|
+
|
|
120
|
+
### RULE DER-001: Evidence required
|
|
121
|
+
Every observed requirement **MUST** cite source evidence using file paths and, when possible, line references. Claims without evidence **MUST** be marked `INFERRED` or moved to Open Questions.
|
|
122
|
+
|
|
123
|
+
### RULE DER-002: No invented product behavior
|
|
124
|
+
The agent **MUST NOT** invent behavior that is not visible in source code, tests, docs, or configuration. If behavior seems likely but is not proven, mark it `INFERRED`.
|
|
125
|
+
|
|
126
|
+
### RULE DER-003: Separate observed vs inferred
|
|
127
|
+
The output **MUST** separate:
|
|
128
|
+
- `OBSERVED`: directly supported by source evidence
|
|
129
|
+
- `INFERRED`: likely but not directly proven
|
|
130
|
+
- `UNKNOWN`: cannot be determined from code
|
|
131
|
+
|
|
132
|
+
### RULE DER-004: No production code changes
|
|
133
|
+
This command **MUST NOT** modify production code. It may write docs under `docs/project/requirements/` and optionally create project tickets when `create_tickets=true`.
|
|
134
|
+
|
|
135
|
+
### RULE DER-005: Tests are evidence, not truth alone
|
|
136
|
+
Tests may prove intended behavior, but the agent **MUST** compare tests with implementation. If tests and code disagree, document the disagreement as a gap.
|
|
137
|
+
|
|
138
|
+
### RULE DER-006: Preserve implementation neutrality
|
|
139
|
+
Requirement text **MUST** describe WHAT the system does and WHY it matters. It **MUST NOT** prescribe HOW to refactor or implement unless listing technical evidence.
|
|
140
|
+
|
|
141
|
+
### RULE DER-007: Ask when scope is unsafe
|
|
142
|
+
If the requested scope is too broad to analyze reliably, the agent **MUST** stop and ask for a narrower module, route, or feature area.
|
|
143
|
+
|
|
144
|
+
## 📤 Output Document Template
|
|
145
|
+
|
|
146
|
+
````markdown
|
|
147
|
+
# Requirements: <Feature / Scope>
|
|
148
|
+
|
|
149
|
+
**Source scope**: `<scope>`
|
|
150
|
+
**Generated by**: business-analyst-agent
|
|
151
|
+
**Generated at**: <timestamp>
|
|
152
|
+
**Status**: Reverse-documented from existing source code
|
|
153
|
+
|
|
154
|
+
## Summary
|
|
155
|
+
[Short description of current behavior]
|
|
156
|
+
|
|
157
|
+
## Evidence Map
|
|
158
|
+
| Area | Files |
|
|
159
|
+
|------|-------|
|
|
160
|
+
| Routes/API | `path/to/file` |
|
|
161
|
+
| UI | `path/to/file` |
|
|
162
|
+
| Tests | `path/to/file` |
|
|
163
|
+
| Config/Policies | `path/to/file` |
|
|
164
|
+
|
|
165
|
+
## Personas
|
|
166
|
+
- [OBSERVED] As a <persona> ...
|
|
167
|
+
- [INFERRED] As a <persona> ...
|
|
168
|
+
|
|
169
|
+
## User Stories
|
|
170
|
+
|
|
171
|
+
### US-001: <Title>
|
|
172
|
+
**Status**: OBSERVED | INFERRED
|
|
173
|
+
**Evidence**:
|
|
174
|
+
- `path/to/file`
|
|
175
|
+
|
|
176
|
+
**As a** <persona>
|
|
177
|
+
**I want** <action>
|
|
178
|
+
**So that** <value>
|
|
179
|
+
|
|
180
|
+
### Acceptance Criteria
|
|
181
|
+
|
|
182
|
+
**Scenario 1: <Happy path>**
|
|
183
|
+
```gherkin
|
|
184
|
+
Given ...
|
|
185
|
+
When ...
|
|
186
|
+
Then ...
|
|
187
|
+
````
|
|
188
|
+
|
|
189
|
+
## Business Rules
|
|
190
|
+
| Rule | Status | Evidence |
|
|
191
|
+
|------|--------|----------|
|
|
192
|
+
| <rule> | OBSERVED | `path/to/file` |
|
|
193
|
+
|
|
194
|
+
## Edge Cases & Error Handling
|
|
195
|
+
| Case | Behavior | Evidence |
|
|
196
|
+
|------|----------|----------|
|
|
197
|
+
| <case> | <behavior> | `path/to/file` |
|
|
198
|
+
|
|
199
|
+
## Non-Functional Requirements
|
|
200
|
+
- Performance:
|
|
201
|
+
- Security:
|
|
202
|
+
- Accessibility:
|
|
203
|
+
- Observability:
|
|
204
|
+
|
|
205
|
+
## Gaps / Ambiguities
|
|
206
|
+
- [UNKNOWN] <question or missing evidence>
|
|
207
|
+
- [MISMATCH] <test/code/doc disagreement>
|
|
208
|
+
|
|
209
|
+
## Follow-Up Recommendations
|
|
210
|
+
- Create ticket for <gap>
|
|
211
|
+
- Add test for <behavior>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## 📥 Input Examples
|
|
215
|
+
|
|
216
|
+
### Module
|
|
217
|
+
```text
|
|
218
|
+
/document-existing-requirements auth
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Route path
|
|
222
|
+
```text
|
|
223
|
+
/document-existing-requirements src/app/login
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### With explicit output path
|
|
227
|
+
```text
|
|
228
|
+
/document-existing-requirements --output_path=docs/project/requirements/password-reset.md auth/password-reset
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## 🚫 Failure Modes
|
|
232
|
+
|
|
233
|
+
| Failure | Required action |
|
|
234
|
+
|---------|-----------------|
|
|
235
|
+
| Scope too broad | ABORT and ask for narrower scope |
|
|
236
|
+
| No matching files | ABORT and report searched paths |
|
|
237
|
+
| Evidence insufficient | Write only OBSERVED claims and list UNKNOWN items |
|
|
238
|
+
| Tests contradict implementation | Document mismatch and recommend follow-up |
|
|
239
|
+
| Output path outside docs | ABORT unless explicitly allowed by project rules |
|
|
240
|
+
|
|
241
|
+
## 🔗 Related Commands
|
|
242
|
+
|
|
243
|
+
- `/discover-codebase` - map modules before requirement extraction
|
|
244
|
+
- `/analyze-requirements` - create new requirements from stakeholder input
|
|
245
|
+
- `/groom-ticket` - refine tickets created from discovered gaps
|
|
246
|
+
- `/write-plan` - create implementation plan after requirements are accepted
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: planning-estimate-task
|
|
3
|
+
description: Use when the user asks to run /estimate-task, estimate a ticket, update story points, compare implementation complexity, or sanity-check effort with technical and product context.
|
|
4
|
+
command: /estimate-task
|
|
5
|
+
display_name: "Estimate Task"
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
status: READY
|
|
8
|
+
owner_agent: tech-lead
|
|
9
|
+
consults_agents:
|
|
10
|
+
- developer
|
|
11
|
+
- business-analyst
|
|
12
|
+
model_preference: sonnet
|
|
13
|
+
args:
|
|
14
|
+
- name: ticket_id
|
|
15
|
+
required: true
|
|
16
|
+
format: "TICKET-XXX"
|
|
17
|
+
preconditions:
|
|
18
|
+
- ticket_exists: true
|
|
19
|
+
- ticket_has_acceptance_criteria: true
|
|
20
|
+
postconditions:
|
|
21
|
+
- estimate_updated: true
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# /estimate-task
|
|
25
|
+
|
|
26
|
+
> Estimates or re-estimates a ticket using evidence, complexity factors, and Fibonacci points.
|
|
27
|
+
|
|
28
|
+
## 🎯 Purpose
|
|
29
|
+
|
|
30
|
+
Provide a traceable estimate for planning and detect tickets that need splitting.
|
|
31
|
+
|
|
32
|
+
## 🔄 Execution Flow
|
|
33
|
+
|
|
34
|
+
1. Load ticket, AC, technical notes, and previous estimates.
|
|
35
|
+
2. Inspect related code or past similar tickets.
|
|
36
|
+
3. Identify complexity drivers, risks, dependencies, and unknowns.
|
|
37
|
+
4. Select Fibonacci estimate: 1, 2, 3, 5, or 8.
|
|
38
|
+
5. If larger than 8, recommend split instead of estimating higher.
|
|
39
|
+
6. Update `estimate` and add comment with rationale.
|
|
40
|
+
7. Run `/validate-state`.
|
|
41
|
+
|
|
42
|
+
## 🔒 Hard Rules
|
|
43
|
+
|
|
44
|
+
- MUST cite evidence and complexity factors.
|
|
45
|
+
- MUST NOT estimate above 8 for sprint work.
|
|
46
|
+
- MUST NOT change BA-owned acceptance criteria.
|
|
47
|
+
- MUST re-check DoR if estimate changes after `READY`.
|
|
48
|
+
|
|
49
|
+
## 📤 Outputs
|
|
50
|
+
|
|
51
|
+
- Story point estimate
|
|
52
|
+
- Rationale
|
|
53
|
+
- Risks and unknowns
|
|
54
|
+
- Split recommendation if needed
|
|
55
|
+
|
|
56
|
+
## 🔗 Related Commands
|
|
57
|
+
|
|
58
|
+
- `/groom-ticket`
|
|
59
|
+
- `/mark-ready`
|
|
60
|
+
- `/plan-sprint`
|