ai-core-framework 0.1.0 → 0.3.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/README.md +19 -19
- package/{core/agents → agents}/business-analyst.md +7 -7
- package/{core/agents → agents}/developer.md +2 -2
- package/{core/agents → agents}/qa-tester.md +3 -3
- package/{core/agents → agents}/scrum-master.md +16 -12
- package/{core/agents → agents}/tech-lead.md +4 -4
- package/bin/ai-core-framework.js +4 -4
- package/{core → docs}/config/backlog.schema.json +1 -1
- package/{core → docs}/config/release.schema.json +1 -1
- package/{core → docs}/config/ticket.schema.json +1 -1
- package/hooks/hooks-cursor.json +16 -0
- package/hooks/hooks.json +16 -0
- package/hooks/session-start +21 -0
- package/lib/install-codex.js +39 -7
- package/package.json +9 -2
- package/{core/rules → rules}/00-global-rules.md +18 -18
- package/{core/rules → rules}/02-code-quality.md +1 -1
- package/{core/rules → rules}/04-documentation.md +1 -1
- package/{core/rules → rules}/05-testing-mandatory.md +2 -2
- package/{core/rules → rules}/06-approval-gates.md +2 -2
- package/{core/rules → rules}/08-definition-of-done.md +1 -1
- package/{core/scripts → scripts}/ai-core.sh +43 -21
- package/{core/scripts → scripts}/generate-views.sh +2 -2
- package/{core/scripts → scripts}/install-codex-prompts.sh +23 -15
- package/{core/scripts → scripts}/log-user-request.sh +5 -5
- package/{core/scripts → scripts}/setup-project.sh +33 -38
- package/{core/scripts → scripts}/sync-platforms.sh +49 -45
- package/{core/scripts → scripts}/validate-audit-log.sh +2 -2
- package/{core/scripts → scripts}/validate-docs.sh +6 -6
- package/{core/scripts → scripts}/validate-permissions.sh +17 -3
- package/{core/scripts → scripts}/validate-state.sh +6 -6
- package/{core/scripts → scripts}/workflow.sh +16 -16
- package/{core/skills → skills}/ai-core-commands/SKILL.md +9 -9
- package/{core/skills → skills}/brainstorming/SKILL.md +1 -1
- package/{core/skills → skills}/development-implement-task/SKILL.md +7 -7
- package/{core/skills → skills}/meta-generate-views/SKILL.md +8 -8
- package/{core/skills → skills}/meta-request-log/SKILL.md +4 -4
- package/{core/skills → skills}/meta-sprint-report/SKILL.md +2 -2
- package/{core/skills → skills}/meta-sync-platforms/SKILL.md +5 -5
- package/{core/skills → skills}/meta-ticket-health/SKILL.md +1 -1
- package/{core/skills → skills}/meta-validate-audit-log/SKILL.md +2 -2
- package/{core/skills → skills}/meta-validate-docs/SKILL.md +1 -1
- package/{core/skills → skills}/meta-validate-permissions/SKILL.md +2 -2
- package/{core/skills → skills}/meta-validate-state/SKILL.md +4 -4
- package/{core/skills → skills}/planning-analyze-requirements/SKILL.md +10 -10
- package/{core/skills → skills}/planning-backlog-status/SKILL.md +6 -6
- package/{core/skills → skills}/planning-groom-ticket/SKILL.md +4 -4
- package/{core/skills → skills}/planning-mark-ready/SKILL.md +3 -3
- package/{core/skills → skills}/planning-plan-refactor/SKILL.md +6 -6
- package/{core/skills → skills}/planning-plan-sprint/SKILL.md +4 -4
- package/{core/skills → skills}/planning-prioritize-backlog/SKILL.md +2 -2
- package/{core/skills → skills}/planning-write-plan/SKILL.md +1 -1
- package/{core/skills → skills}/project-detect-stack/SKILL.md +1 -1
- package/{core/skills → skills}/project-discover-codebase/SKILL.md +2 -2
- package/skills/project-setup-project/SKILL.md +113 -0
- package/{core/skills → skills}/qa-bug-status/SKILL.md +1 -1
- package/{core/skills → skills}/qa-report-bug/SKILL.md +8 -8
- package/{core/skills → skills}/qa-smoke-test/SKILL.md +3 -3
- package/{core/skills → skills}/qa-verify-fix/SKILL.md +3 -3
- package/{core/skills → skills}/release-hotfix/SKILL.md +2 -2
- package/{core/skills → skills}/release-release/SKILL.md +2 -2
- package/{core/skills → skills}/release-rollback/SKILL.md +1 -1
- package/{core/skills → skills}/review-create-pr/SKILL.md +2 -2
- package/{core/skills → skills}/review-merge-pr/SKILL.md +1 -1
- package/{core/skills → skills}/using-ai-core/SKILL.md +7 -7
- package/{core/skills → skills}/verification-before-done/SKILL.md +1 -1
- package/{core/templates → templates}/ci/ai-core-governance.yml +29 -19
- package/{core/templates → templates}/pr/pull-request-template.md +1 -1
- package/{core/templates → templates}/project/CODEOWNERS +8 -3
- package/templates/project/docs-policy.json +3 -0
- package/templates/project/project-structure.yaml +76 -0
- package/{core/templates → templates}/qa/bug-report-template.md +1 -1
- package/{core/templates → templates}/requirements/user-story-template.md +1 -1
- package/{core/workflows → workflows}/bug-lifecycle.md +3 -3
- package/{core/workflows → workflows}/feature-lifecycle.md +2 -2
- package/{core/workflows → workflows}/sprint-lifecycle.md +2 -2
- package/core/README.md +0 -162
- package/core/skills/project-setup-project/SKILL.md +0 -113
- package/core/templates/project/docs-policy.json +0 -3
- package/core/templates/project/project-structure.yaml +0 -76
- /package/{core/agents → agents}/README.md +0 -0
- /package/{core → docs}/config/docs-policy.default.json +0 -0
- /package/{core/rules → rules}/01-git-workflow.md +0 -0
- /package/{core/rules → rules}/03-security.md +0 -0
- /package/{core/rules → rules}/07-definition-of-ready.md +0 -0
- /package/{core/skills → skills}/README.md +0 -0
- /package/{core/skills → skills}/executing-ticket/SKILL.md +0 -0
- /package/{core/skills → skills}/git-branch-status/SKILL.md +0 -0
- /package/{core/skills → skills}/git-cleanup-branches/SKILL.md +0 -0
- /package/{core/skills → skills}/git-scan-untracked/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-document-existing-requirements/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-estimate-task/SKILL.md +0 -0
- /package/{core/skills → skills}/qa-triage-bug/SKILL.md +0 -0
- /package/{core/skills → skills}/review-techlead-review/SKILL.md +0 -0
- /package/{core/skills → skills}/writing-implementation-plan/SKILL.md +0 -0
- /package/{core/templates → templates}/ci/node-pnpm.yml +0 -0
- /package/{core/templates → templates}/pm/retrospective-template.md +0 -0
- /package/{core/templates → templates}/pm/sprint-plan-template.md +0 -0
- /package/{core/templates → templates}/project/project-config.yaml +0 -0
- /package/{core/templates → templates}/qa/test-plan-template.md +0 -0
- /package/{core/templates → templates}/release/release-record-template.json +0 -0
- /package/{core/templates → templates}/requirements/PRD-template.md +0 -0
- /package/{core/templates → templates}/technical/ADR-template.md +0 -0
- /package/{core/templates → templates}/technical/refactor-plan-template.md +0 -0
- /package/{core/templates → templates}/technical/tech-design-template.md +0 -0
- /package/{core/workflows → workflows}/hotfix-lifecycle.md +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/ai-core.sh
|
|
3
3
|
#
|
|
4
4
|
# Lightweight command runner for executable AI Core commands.
|
|
5
5
|
#
|
|
@@ -21,7 +21,7 @@ log_warn() { echo -e "${YELLOW}!${NC} $1"; }
|
|
|
21
21
|
log_fail() { echo -e "${RED}x${NC} $1"; }
|
|
22
22
|
|
|
23
23
|
AI_CORE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
24
|
-
PROJECT_ROOT="$
|
|
24
|
+
PROJECT_ROOT="$AI_CORE_DIR"
|
|
25
25
|
|
|
26
26
|
usage() {
|
|
27
27
|
cat <<'EOF'
|
|
@@ -32,10 +32,10 @@ Usage:
|
|
|
32
32
|
next TICKET-XXX
|
|
33
33
|
|
|
34
34
|
Internal runner form:
|
|
35
|
-
bash
|
|
36
|
-
bash
|
|
37
|
-
bash
|
|
38
|
-
bash
|
|
35
|
+
bash scripts/ai-core.sh [--agent role] run /command [args...]
|
|
36
|
+
bash scripts/ai-core.sh [--agent role] guide /command [args...]
|
|
37
|
+
bash scripts/ai-core.sh [--agent role] next TICKET-XXX
|
|
38
|
+
bash scripts/ai-core.sh list
|
|
39
39
|
|
|
40
40
|
Environment:
|
|
41
41
|
AI_AGENT=<agent-role> Optional internal override. Runner auto-selects owner_agent by default.
|
|
@@ -60,7 +60,21 @@ command_file_for() {
|
|
|
60
60
|
local command="$1"
|
|
61
61
|
local name
|
|
62
62
|
name=$(command_name "$command")
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
if [ -d "$AI_CORE_DIR/commands" ]; then
|
|
65
|
+
find "$AI_CORE_DIR/commands" -name "$name.md" -type f | head -1
|
|
66
|
+
return 0
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if [ -d "$AI_CORE_DIR/skills" ]; then
|
|
70
|
+
find "$AI_CORE_DIR/skills" -name 'SKILL.md' -type f -print0 |
|
|
71
|
+
while IFS= read -r -d '' file; do
|
|
72
|
+
if awk -v command="/$name" '$1 == "command:" && $2 == command { found=1 } END { exit found ? 0 : 1 }' "$file"; then
|
|
73
|
+
printf '%s\n' "$file"
|
|
74
|
+
break
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
77
|
+
fi
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
allowed_agents_for_command() {
|
|
@@ -174,12 +188,12 @@ run_command() {
|
|
|
174
188
|
}
|
|
175
189
|
|
|
176
190
|
ticket_file() {
|
|
177
|
-
printf '%s/project/tickets/%s.json' "$PROJECT_ROOT" "$1"
|
|
191
|
+
printf '%s/docs/runtime/project/tickets/%s.json' "$PROJECT_ROOT" "$1"
|
|
178
192
|
}
|
|
179
193
|
|
|
180
194
|
latest_audit_field() {
|
|
181
195
|
local field="$1"
|
|
182
|
-
local audit_file="$PROJECT_ROOT/project/audit-log.jsonl"
|
|
196
|
+
local audit_file="$PROJECT_ROOT/docs/runtime/project/audit-log.jsonl"
|
|
183
197
|
if [ ! -s "$audit_file" ]; then
|
|
184
198
|
printf ''
|
|
185
199
|
return 0
|
|
@@ -323,20 +337,20 @@ guide_command() {
|
|
|
323
337
|
echo ""
|
|
324
338
|
echo "Updated:"
|
|
325
339
|
if [ -n "$ticket_id" ] && [ -f "$(ticket_file "$ticket_id")" ]; then
|
|
326
|
-
echo "- project/tickets/$ticket_id.json"
|
|
340
|
+
echo "- docs/runtime/project/tickets/$ticket_id.json"
|
|
327
341
|
fi
|
|
328
|
-
if [ "$before_audit_hash" != "$after_audit_hash" ] && [ -s "project/audit-log.jsonl" ]; then
|
|
329
|
-
echo "- project/audit-log.jsonl"
|
|
342
|
+
if [ "$before_audit_hash" != "$after_audit_hash" ] && [ -s "docs/runtime/project/audit-log.jsonl" ]; then
|
|
343
|
+
echo "- docs/runtime/project/audit-log.jsonl"
|
|
330
344
|
fi
|
|
331
345
|
case "$(command_name "$command")" in
|
|
332
346
|
generate-views)
|
|
333
|
-
echo "- project/views/*.md"
|
|
347
|
+
echo "- docs/runtime/project/views/*.md"
|
|
334
348
|
;;
|
|
335
349
|
smoke-test)
|
|
336
|
-
echo "- project/test-runs/${ticket_id}-*.md"
|
|
350
|
+
echo "- docs/runtime/project/test-runs/${ticket_id}-*.md"
|
|
337
351
|
;;
|
|
338
352
|
release)
|
|
339
|
-
echo "- project/releases/*.json"
|
|
353
|
+
echo "- docs/runtime/project/releases/*.json"
|
|
340
354
|
;;
|
|
341
355
|
esac
|
|
342
356
|
|
|
@@ -388,12 +402,20 @@ next_command() {
|
|
|
388
402
|
}
|
|
389
403
|
|
|
390
404
|
list_commands() {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
405
|
+
{
|
|
406
|
+
if [ -d "$AI_CORE_DIR/commands" ]; then
|
|
407
|
+
find "$AI_CORE_DIR/commands" -name '*.md' -type f |
|
|
408
|
+
grep -v '/README.md$' |
|
|
409
|
+
sed "s#^$AI_CORE_DIR/commands/##" |
|
|
410
|
+
sed 's#/# #g; s#\.md$##' |
|
|
411
|
+
awk '{ print "/" $NF }'
|
|
412
|
+
fi
|
|
413
|
+
|
|
414
|
+
if [ -d "$AI_CORE_DIR/skills" ]; then
|
|
415
|
+
find "$AI_CORE_DIR/skills" -name 'SKILL.md' -type f -print0 |
|
|
416
|
+
xargs -0 awk '$1 == "command:" { print $2 }'
|
|
417
|
+
fi
|
|
418
|
+
} | sort -u
|
|
397
419
|
}
|
|
398
420
|
|
|
399
421
|
main() {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Generates human-readable views from project without changing canonical state.
|
|
5
5
|
# Canonical sources:
|
|
6
|
-
# - project/backlog/backlog.json for backlog order
|
|
7
|
-
# - project/tickets/*.json for ticket details and state history
|
|
6
|
+
# - docs/runtime/project/backlog/backlog.json for backlog order
|
|
7
|
+
# - docs/runtime/project/tickets/*.json for ticket details and state history
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/install-codex-prompts.sh
|
|
3
3
|
#
|
|
4
4
|
# Installs AI Core command wrappers as Codex custom slash prompts.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
# bash
|
|
8
|
-
# CODEX_PROMPTS_DIR=~/.codex/prompts bash
|
|
7
|
+
# bash scripts/install-codex-prompts.sh
|
|
8
|
+
# CODEX_PROMPTS_DIR=~/.codex/prompts bash scripts/install-codex-prompts.sh
|
|
9
9
|
|
|
10
10
|
set -euo pipefail
|
|
11
11
|
|
|
@@ -50,9 +50,9 @@ write_prompt() {
|
|
|
50
50
|
prompt_file="$PROMPTS_DIR/${command#/}.md"
|
|
51
51
|
rel_command_file="${command_file#./}"
|
|
52
52
|
fallback_command_file="${root}/${rel_command_file}"
|
|
53
|
-
fallback_rules_file="${root}/
|
|
54
|
-
fallback_agents_dir="${root}/
|
|
55
|
-
fallback_log_script="${root}/
|
|
53
|
+
fallback_rules_file="${root}/rules/00-global-rules.md"
|
|
54
|
+
fallback_agents_dir="${root}/agents"
|
|
55
|
+
fallback_log_script="${root}/scripts/log-user-request.sh"
|
|
56
56
|
description="${display_name:-AI Core command ${command}}"
|
|
57
57
|
|
|
58
58
|
cat > "$prompt_file" <<EOF
|
|
@@ -72,8 +72,8 @@ Mandatory steps:
|
|
|
72
72
|
|
|
73
73
|
1. Log this user request first. Prefer the project-local script when it exists; otherwise use the installed AI Core fallback:
|
|
74
74
|
\`\`\`bash
|
|
75
|
-
if [ -f
|
|
76
|
-
AI_AGENT=codex bash
|
|
75
|
+
if [ -f scripts/log-user-request.sh ]; then
|
|
76
|
+
AI_AGENT=codex bash scripts/log-user-request.sh "${command} \$ARGUMENTS"
|
|
77
77
|
else
|
|
78
78
|
AI_AGENT=codex bash ${fallback_log_script} "${command} \$ARGUMENTS"
|
|
79
79
|
fi
|
|
@@ -87,13 +87,13 @@ Mandatory steps:
|
|
|
87
87
|
|
|
88
88
|
3. Read and follow the global rules. Prefer the project-local path when it exists; otherwise use the installed AI Core fallback:
|
|
89
89
|
\`\`\`text
|
|
90
|
-
|
|
90
|
+
rules/00-global-rules.md
|
|
91
91
|
${fallback_rules_file}
|
|
92
92
|
\`\`\`
|
|
93
93
|
|
|
94
94
|
4. Infer the owner agent from the command frontmatter. If an agent file exists, read it before acting. Prefer the project-local path, then the installed fallback:
|
|
95
95
|
\`\`\`text
|
|
96
|
-
|
|
96
|
+
agents/<owner_agent>.md
|
|
97
97
|
${fallback_agents_dir}/<owner_agent>.md
|
|
98
98
|
\`\`\`
|
|
99
99
|
|
|
@@ -110,16 +110,24 @@ main() {
|
|
|
110
110
|
root="$(repo_root)"
|
|
111
111
|
cd "$root"
|
|
112
112
|
|
|
113
|
-
if [ ! -d "
|
|
114
|
-
log_fail "Missing
|
|
113
|
+
if [ ! -d "commands" ] && [ ! -d "skills" ]; then
|
|
114
|
+
log_fail "Missing commands or skills. Run from AI Core repo root."
|
|
115
115
|
exit 1
|
|
116
116
|
fi
|
|
117
117
|
|
|
118
118
|
mkdir -p "$PROMPTS_DIR"
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
if [ -d "commands" ]; then
|
|
121
|
+
while IFS= read -r command_file; do
|
|
122
|
+
write_prompt "$command_file" "$root"
|
|
123
|
+
done < <(find commands -name '*.md' -type f | sort)
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
if [ -d "skills" ]; then
|
|
127
|
+
while IFS= read -r command_file; do
|
|
128
|
+
write_prompt "$command_file" "$root"
|
|
129
|
+
done < <(find skills -name 'SKILL.md' -type f | sort)
|
|
130
|
+
fi
|
|
123
131
|
|
|
124
132
|
log_pass "AI Core Codex prompts installed in ${PROMPTS_DIR}"
|
|
125
133
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/log-user-request.sh
|
|
3
3
|
#
|
|
4
|
-
# Append a sanitized user request record to project/user-requests.jsonl.
|
|
4
|
+
# Append a sanitized user request record to docs/runtime/project/user-requests.jsonl.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
# bash
|
|
7
|
+
# bash scripts/log-user-request.sh "user request text"
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
11
11
|
REQUEST_TEXT="${*:-}"
|
|
12
|
-
LOG_FILE="${AI_CORE_USER_REQUEST_LOG:-project/user-requests.jsonl}"
|
|
12
|
+
LOG_FILE="${AI_CORE_USER_REQUEST_LOG:-docs/runtime/project/user-requests.jsonl}"
|
|
13
13
|
|
|
14
14
|
RED='\033[0;31m'
|
|
15
15
|
GREEN='\033[0;32m'
|
|
@@ -19,7 +19,7 @@ log_pass() { echo -e "${GREEN}+${NC} $1"; }
|
|
|
19
19
|
log_fail() { echo -e "${RED}x${NC} $1"; }
|
|
20
20
|
|
|
21
21
|
if [ -z "$REQUEST_TEXT" ]; then
|
|
22
|
-
log_fail "Usage: bash
|
|
22
|
+
log_fail "Usage: bash scripts/log-user-request.sh \"user request text\""
|
|
23
23
|
exit 2
|
|
24
24
|
fi
|
|
25
25
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/setup-project.sh
|
|
3
3
|
#
|
|
4
|
-
# Makes
|
|
4
|
+
# Makes copied root-level framework folders operational in a project.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
# bash
|
|
7
|
+
# bash scripts/setup-project.sh
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
@@ -33,7 +33,7 @@ copy_if_missing() {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
write_backlog_if_missing() {
|
|
36
|
-
local path="project/backlog/backlog.json"
|
|
36
|
+
local path="docs/runtime/project/backlog/backlog.json"
|
|
37
37
|
|
|
38
38
|
if [ -f "$path" ]; then
|
|
39
39
|
log_pass "Preserved existing $path"
|
|
@@ -48,7 +48,7 @@ install_framework_scripts() {
|
|
|
48
48
|
mkdir -p scripts
|
|
49
49
|
|
|
50
50
|
for script in ai-core.sh workflow.sh validate-state.sh validate-docs.sh validate-permissions.sh validate-audit-log.sh generate-views.sh install-codex-prompts.sh log-user-request.sh setup-project.sh; do
|
|
51
|
-
local src="
|
|
51
|
+
local src="scripts/$script"
|
|
52
52
|
local dst="scripts/$script"
|
|
53
53
|
|
|
54
54
|
if [ ! -f "$src" ]; then
|
|
@@ -68,7 +68,7 @@ install_framework_scripts() {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
install_governance_workflow() {
|
|
71
|
-
local src="
|
|
71
|
+
local src="templates/ci/ai-core-governance.yml"
|
|
72
72
|
local dst=".github/workflows/ai-core-governance.yml"
|
|
73
73
|
|
|
74
74
|
if [ ! -f "$src" ]; then
|
|
@@ -103,35 +103,30 @@ main() {
|
|
|
103
103
|
repo_root=$(git rev-parse --show-toplevel)
|
|
104
104
|
cd "$repo_root"
|
|
105
105
|
|
|
106
|
-
if [ ! -
|
|
107
|
-
|
|
106
|
+
if [ ! -f "templates/project/project-config.yaml" ] ||
|
|
107
|
+
[ ! -f "templates/project/project-structure.yaml" ]; then
|
|
108
|
+
log_fail "Missing framework project templates"
|
|
108
109
|
exit 1
|
|
109
110
|
fi
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
mkdir -p config
|
|
118
|
-
copy_if_missing "core/templates/project/project-config.yaml" "config/project-config.yaml"
|
|
119
|
-
copy_if_missing "core/templates/project/project-structure.yaml" "config/project-structure.yaml"
|
|
120
|
-
copy_if_missing "core/templates/project/docs-policy.json" "config/docs-policy.json"
|
|
121
|
-
copy_if_missing "core/templates/project/CODEOWNERS" "CODEOWNERS"
|
|
112
|
+
mkdir -p docs/config
|
|
113
|
+
copy_if_missing "templates/project/project-config.yaml" "docs/config/project-config.yaml"
|
|
114
|
+
copy_if_missing "templates/project/project-structure.yaml" "docs/config/project-structure.yaml"
|
|
115
|
+
copy_if_missing "templates/project/docs-policy.json" "docs/config/docs-policy.json"
|
|
116
|
+
copy_if_missing "templates/project/CODEOWNERS" "CODEOWNERS"
|
|
122
117
|
|
|
123
118
|
for dir in \
|
|
124
|
-
project/tickets \
|
|
125
|
-
project/backlog \
|
|
126
|
-
project/bugs \
|
|
127
|
-
project/sprints \
|
|
128
|
-
project/releases \
|
|
129
|
-
project/metrics \
|
|
130
|
-
project/views \
|
|
131
|
-
project/test-runs \
|
|
132
|
-
project/verifications \
|
|
133
|
-
project/incidents \
|
|
134
|
-
project/prs \
|
|
119
|
+
docs/runtime/project/tickets \
|
|
120
|
+
docs/runtime/project/backlog \
|
|
121
|
+
docs/runtime/project/bugs \
|
|
122
|
+
docs/runtime/project/sprints \
|
|
123
|
+
docs/runtime/project/releases \
|
|
124
|
+
docs/runtime/project/metrics \
|
|
125
|
+
docs/runtime/project/views \
|
|
126
|
+
docs/runtime/project/test-runs \
|
|
127
|
+
docs/runtime/project/verifications \
|
|
128
|
+
docs/runtime/project/incidents \
|
|
129
|
+
docs/runtime/project/prs \
|
|
135
130
|
docs/project/product \
|
|
136
131
|
docs/project/planning \
|
|
137
132
|
docs/project/specs \
|
|
@@ -152,21 +147,21 @@ main() {
|
|
|
152
147
|
log_pass "Created required state and docs directories"
|
|
153
148
|
|
|
154
149
|
write_backlog_if_missing
|
|
155
|
-
touch project/audit-log.jsonl
|
|
156
|
-
touch project/user-requests.jsonl
|
|
150
|
+
touch docs/runtime/project/audit-log.jsonl
|
|
151
|
+
touch docs/runtime/project/user-requests.jsonl
|
|
157
152
|
install_framework_scripts
|
|
158
153
|
install_governance_workflow
|
|
159
154
|
|
|
160
|
-
if [ -f "
|
|
161
|
-
bash
|
|
155
|
+
if [ -f "scripts/sync-platforms.sh" ]; then
|
|
156
|
+
bash scripts/sync-platforms.sh
|
|
162
157
|
else
|
|
163
|
-
log_warn "Missing
|
|
158
|
+
log_warn "Missing scripts/sync-platforms.sh; platform configs not synced"
|
|
164
159
|
fi
|
|
165
160
|
|
|
166
|
-
if [ -f "
|
|
167
|
-
bash
|
|
161
|
+
if [ -f "scripts/validate-state.sh" ]; then
|
|
162
|
+
bash scripts/validate-state.sh
|
|
168
163
|
else
|
|
169
|
-
log_warn "Missing
|
|
164
|
+
log_warn "Missing scripts/validate-state.sh; skipped state validation"
|
|
170
165
|
fi
|
|
171
166
|
|
|
172
167
|
if [ -d ".githooks" ] && [ -f "scripts/install-hooks.sh" ]; then
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# ============================================================================
|
|
3
3
|
# sync-platforms.sh
|
|
4
|
-
# Sync
|
|
5
|
-
# Usage: bash
|
|
4
|
+
# Sync root-level framework folders to Claude Code, Cursor, and Windsurf format.
|
|
5
|
+
# Usage: bash scripts/sync-platforms.sh
|
|
6
6
|
# ============================================================================
|
|
7
7
|
|
|
8
8
|
set -euo pipefail
|
|
9
9
|
|
|
10
10
|
AI_CORE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
PROJECT_ROOT="$
|
|
11
|
+
PROJECT_ROOT="$AI_CORE_DIR"
|
|
12
12
|
|
|
13
|
-
echo "🔄 Syncing
|
|
13
|
+
echo "🔄 Syncing root-level framework folders to AI platforms..."
|
|
14
14
|
echo " Source: $AI_CORE_DIR"
|
|
15
15
|
echo " Target: $PROJECT_ROOT"
|
|
16
16
|
|
|
@@ -41,14 +41,16 @@ sync_claude_code() {
|
|
|
41
41
|
done
|
|
42
42
|
|
|
43
43
|
# --- Sync commands (flatten from subdirs) ---
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
if [ -d "$AI_CORE_DIR/commands" ]; then
|
|
45
|
+
find "$AI_CORE_DIR/commands" -name "*.md" -type f | while read -r cmd_file; do
|
|
46
|
+
local basename
|
|
47
|
+
basename=$(basename "$cmd_file")
|
|
48
|
+
# Skip README files
|
|
49
|
+
[[ "$basename" == "README.md" ]] && continue
|
|
50
|
+
cp "$cmd_file" "$claude_dir/commands/$basename"
|
|
51
|
+
echo " ✓ command: $basename"
|
|
52
|
+
done
|
|
53
|
+
fi
|
|
52
54
|
|
|
53
55
|
# --- Sync skills ---
|
|
54
56
|
for skill_file in "$AI_CORE_DIR"/skills/*/SKILL.md; do
|
|
@@ -64,26 +66,26 @@ sync_claude_code() {
|
|
|
64
66
|
cat > "$PROJECT_ROOT/CLAUDE.md" <<'EOF'
|
|
65
67
|
# Project Instructions for Claude Code
|
|
66
68
|
|
|
67
|
-
This project uses
|
|
69
|
+
This project uses root-level framework folders for structured Agile/Scrum development.
|
|
68
70
|
|
|
69
71
|
## 🚨 CRITICAL: Read these first
|
|
70
72
|
|
|
71
|
-
1. **Rules**: See `
|
|
72
|
-
2. **Agents**: See `
|
|
73
|
-
3. **Skills**: See `
|
|
74
|
-
4. **Commands**: See `
|
|
75
|
-
5. **Workflows**: See `
|
|
73
|
+
1. **Rules**: See `rules/00-global-rules.md` — **MUST follow**
|
|
74
|
+
2. **Agents**: See `agents/` — pick correct agent for task
|
|
75
|
+
3. **Skills**: See `skills/using-ai-core/SKILL.md` — chat-first bootstrap
|
|
76
|
+
4. **Commands**: See `commands/` — use slash commands for workflows
|
|
77
|
+
5. **Workflows**: See `workflows/feature-lifecycle.md`
|
|
76
78
|
|
|
77
79
|
## Quick reference
|
|
78
80
|
|
|
79
81
|
### User interface
|
|
80
82
|
The normal user interface is the AI chat window. When the user types `/command ...`,
|
|
81
83
|
`guide /command ...`, or `next TICKET-XXX`, interpret it as an AI Core workflow
|
|
82
|
-
request. Do not ask the user to run `bash
|
|
84
|
+
request. Do not ask the user to run `bash scripts/ai-core.sh` or set
|
|
83
85
|
`AI_AGENT`; use those executable scripts internally only when helpful.
|
|
84
86
|
|
|
85
87
|
### Before any code change
|
|
86
|
-
- [ ] There's an active ticket in `project/tickets/` with `status: IN_PROGRESS`
|
|
88
|
+
- [ ] There's an active ticket in `docs/runtime/project/tickets/` with `status: IN_PROGRESS`
|
|
87
89
|
- [ ] You're on the correct feature branch
|
|
88
90
|
- [ ] You're playing the correct agent role inferred from command metadata
|
|
89
91
|
|
|
@@ -100,7 +102,7 @@ DRAFT → GROOMED → READY → IN_PROGRESS → IN_REVIEW → QA → DONE
|
|
|
100
102
|
|
|
101
103
|
## ❌ Absolute prohibitions
|
|
102
104
|
|
|
103
|
-
See `
|
|
105
|
+
See `rules/00-global-rules.md` → G-011
|
|
104
106
|
|
|
105
107
|
## 🎭 Your current role
|
|
106
108
|
|
|
@@ -115,10 +117,10 @@ Read the agent file to understand your boundaries.
|
|
|
115
117
|
|
|
116
118
|
## Skill bootstrap
|
|
117
119
|
|
|
118
|
-
At session start or before any workflow request, read `
|
|
119
|
-
For feature discovery use `
|
|
120
|
-
For implementation plans use `
|
|
121
|
-
For completion claims use `
|
|
120
|
+
At session start or before any workflow request, read `skills/using-ai-core/SKILL.md`.
|
|
121
|
+
For feature discovery use `skills/brainstorming/SKILL.md`.
|
|
122
|
+
For implementation plans use `skills/writing-implementation-plan/SKILL.md`.
|
|
123
|
+
For completion claims use `skills/verification-before-done/SKILL.md`.
|
|
122
124
|
EOF
|
|
123
125
|
echo " ✓ CLAUDE.md"
|
|
124
126
|
|
|
@@ -149,16 +151,16 @@ alwaysApply: true
|
|
|
149
151
|
|
|
150
152
|
# Project Rules
|
|
151
153
|
|
|
152
|
-
This project uses
|
|
154
|
+
This project uses root-level framework folders. Read these files for full context:
|
|
153
155
|
|
|
154
|
-
- `
|
|
155
|
-
- `
|
|
156
|
-
- `
|
|
157
|
-
- `
|
|
156
|
+
- `rules/00-global-rules.md` — Hard rules (MUST follow)
|
|
157
|
+
- `agents/` — Agent personas
|
|
158
|
+
- `commands/` — Workflow commands
|
|
159
|
+
- `workflows/feature-lifecycle.md` — End-to-end process
|
|
158
160
|
|
|
159
161
|
## Top 10 Rules (summary)
|
|
160
162
|
|
|
161
|
-
1. **No code without ticket** (G-001): Active ticket in `project/tickets/` with status IN_PROGRESS
|
|
163
|
+
1. **No code without ticket** (G-001): Active ticket in `docs/runtime/project/tickets/` with status IN_PROGRESS
|
|
162
164
|
2. **State machine**: DRAFT → GROOMED → READY → IN_PROGRESS → IN_REVIEW → QA → DONE. No skipping.
|
|
163
165
|
3. **TDD mandatory**: Tests before code
|
|
164
166
|
4. **Coverage ≥ 80%** on diff
|
|
@@ -167,7 +169,7 @@ This project uses `core/` framework. Read these files for full context:
|
|
|
167
169
|
7. **No direct push** to main/develop
|
|
168
170
|
8. **No secrets** committed
|
|
169
171
|
9. **No self-approval** of PRs
|
|
170
|
-
10. **Follow agent boundaries** in `
|
|
172
|
+
10. **Follow agent boundaries** in `agents/<agent>.md`
|
|
171
173
|
|
|
172
174
|
## Before any task
|
|
173
175
|
|
|
@@ -188,7 +190,7 @@ Users should type workflow commands in chat, for example:
|
|
|
188
190
|
- `guide /mark-ready TICKET-001`
|
|
189
191
|
- `next TICKET-001`
|
|
190
192
|
|
|
191
|
-
Do not require users to type shell commands such as `bash
|
|
193
|
+
Do not require users to type shell commands such as `bash scripts/ai-core.sh`
|
|
192
194
|
or environment variables such as `AI_AGENT=...`. Shell scripts are internal tools
|
|
193
195
|
for deterministic execution, validation, and CI.
|
|
194
196
|
EOF
|
|
@@ -264,15 +266,15 @@ sync_windsurf() {
|
|
|
264
266
|
cat > "$windsurf_file" <<'EOF'
|
|
265
267
|
# Windsurf Project Rules
|
|
266
268
|
|
|
267
|
-
This project uses
|
|
269
|
+
This project uses root-level framework folders for Agile/Scrum enforcement.
|
|
268
270
|
|
|
269
271
|
## Required Reading
|
|
270
272
|
|
|
271
273
|
Before ANY task, read:
|
|
272
|
-
1. `
|
|
273
|
-
2. `
|
|
274
|
-
3. `
|
|
275
|
-
4. `
|
|
274
|
+
1. `rules/00-global-rules.md` — hard rules
|
|
275
|
+
2. `agents/` — role definitions
|
|
276
|
+
3. `skills/using-ai-core/SKILL.md` — chat-first bootstrap
|
|
277
|
+
4. `workflows/feature-lifecycle.md` — process
|
|
276
278
|
|
|
277
279
|
## Non-negotiable rules
|
|
278
280
|
|
|
@@ -284,12 +286,14 @@ EOF
|
|
|
284
286
|
echo "" >> "$windsurf_file"
|
|
285
287
|
echo "## Available commands" >> "$windsurf_file"
|
|
286
288
|
echo "" >> "$windsurf_file"
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
if [ -d "$AI_CORE_DIR/commands" ]; then
|
|
290
|
+
find "$AI_CORE_DIR/commands" -name "*.md" -type f | while read -r cmd_file; do
|
|
291
|
+
local basename
|
|
292
|
+
basename=$(basename "$cmd_file" .md)
|
|
293
|
+
[[ "$basename" == "README" ]] && continue
|
|
294
|
+
echo "- /$basename" >> "$windsurf_file"
|
|
295
|
+
done
|
|
296
|
+
fi
|
|
293
297
|
|
|
294
298
|
echo "" >> "$windsurf_file"
|
|
295
299
|
echo "## Available skills" >> "$windsurf_file"
|
|
@@ -297,7 +301,7 @@ EOF
|
|
|
297
301
|
find "$AI_CORE_DIR/skills" -name "SKILL.md" -type f | while read -r skill_file; do
|
|
298
302
|
local skill_name
|
|
299
303
|
skill_name=$(basename "$(dirname "$skill_file")")
|
|
300
|
-
echo "- $skill_name:
|
|
304
|
+
echo "- $skill_name: skills/$skill_name/SKILL.md" >> "$windsurf_file"
|
|
301
305
|
done
|
|
302
306
|
|
|
303
307
|
echo " ✓ .windsurfrules generated"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/validate-audit-log.sh
|
|
3
3
|
#
|
|
4
4
|
# Validates append-only audit log hash chaining.
|
|
5
5
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
|
|
8
|
-
AUDIT_FILE="project/audit-log.jsonl"
|
|
8
|
+
AUDIT_FILE="docs/runtime/project/audit-log.jsonl"
|
|
9
9
|
RED='\033[0;31m'
|
|
10
10
|
GREEN='\033[0;32m'
|
|
11
11
|
BLUE='\033[0;34m'
|
|
@@ -102,7 +102,7 @@ has_changed_path() {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
load_docs_policy() {
|
|
105
|
-
DOCS_POLICY_FILE="config/docs-policy.json"
|
|
105
|
+
DOCS_POLICY_FILE="docs/config/docs-policy.json"
|
|
106
106
|
|
|
107
107
|
if [ -f "$DOCS_POLICY_FILE" ]; then
|
|
108
108
|
local extends
|
|
@@ -116,7 +116,7 @@ load_docs_policy() {
|
|
|
116
116
|
return 0
|
|
117
117
|
fi
|
|
118
118
|
|
|
119
|
-
DOCS_POLICY_FILE="
|
|
119
|
+
DOCS_POLICY_FILE="docs/config/docs-policy.default.json"
|
|
120
120
|
DOCS_POLICY_JSON=$(jq '.' "$DOCS_POLICY_FILE")
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -162,7 +162,7 @@ current_ticket_id() {
|
|
|
162
162
|
validate_ticket_doc_paths() {
|
|
163
163
|
local errors=0
|
|
164
164
|
|
|
165
|
-
if [ ! -d "project/tickets" ]; then
|
|
165
|
+
if [ ! -d "docs/runtime/project/tickets" ]; then
|
|
166
166
|
return 0
|
|
167
167
|
fi
|
|
168
168
|
|
|
@@ -210,7 +210,7 @@ validate_ticket_doc_paths() {
|
|
|
210
210
|
errors=$((errors + 1))
|
|
211
211
|
fi
|
|
212
212
|
fi
|
|
213
|
-
done < <(find project/tickets -name '*.json' -type f -print0)
|
|
213
|
+
done < <(find docs/runtime/project/tickets -name '*.json' -type f -print0)
|
|
214
214
|
|
|
215
215
|
return "$errors"
|
|
216
216
|
}
|
|
@@ -218,7 +218,7 @@ validate_ticket_doc_paths() {
|
|
|
218
218
|
validate_done_tickets() {
|
|
219
219
|
local errors=0
|
|
220
220
|
|
|
221
|
-
if [ ! -d "project/tickets" ]; then
|
|
221
|
+
if [ ! -d "docs/runtime/project/tickets" ]; then
|
|
222
222
|
return 0
|
|
223
223
|
fi
|
|
224
224
|
|
|
@@ -250,7 +250,7 @@ validate_done_tickets() {
|
|
|
250
250
|
errors=$((errors + 1))
|
|
251
251
|
fi
|
|
252
252
|
fi
|
|
253
|
-
done < <(find project/tickets -name '*.json' -type f -print0)
|
|
253
|
+
done < <(find docs/runtime/project/tickets -name '*.json' -type f -print0)
|
|
254
254
|
|
|
255
255
|
return "$errors"
|
|
256
256
|
}
|