@mriekki/project-forge 0.0.0-stage → 1.0.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.
Files changed (117) hide show
  1. package/README.md +135 -3
  2. package/assets/components.json +33 -0
  3. package/assets/core/distribution.json +66 -0
  4. package/assets/deployment/distribution.json +54 -0
  5. package/assets/generated/ASSEMBLY.json +557 -0
  6. package/assets/generated/core/core/agents/coach.agent.md +69 -0
  7. package/assets/generated/core/core/agents/reviewer.agent.md +85 -0
  8. package/assets/generated/core/core/instructions/project-forge-docs.instructions.md +45 -0
  9. package/assets/generated/core/core/instructions/project-forge-workflow.instructions.md +79 -0
  10. package/assets/generated/core/core/learning/CODING_DRILLS.md +35 -0
  11. package/assets/generated/core/core/learning/DIAGRAM_GUIDE.md +59 -0
  12. package/assets/generated/core/core/learning/ENGINEERING_LEARNING_WORKBOOK.md +108 -0
  13. package/assets/generated/core/core/learning/LEARNING_MAP.md +108 -0
  14. package/assets/generated/core/core/learning/LEARNING_PROGRESS.md +39 -0
  15. package/assets/generated/core/core/learning/RESOURCE_CATALOG.md +25 -0
  16. package/assets/generated/core/core/learning/SQL_DRILLS.md +90 -0
  17. package/assets/generated/core/core/learning/SYSTEM_DESIGN_DRILLS.md +301 -0
  18. package/assets/generated/core/core/process/COACHING_GUIDE.md +92 -0
  19. package/assets/generated/core/core/process/DATABASE_LEARNING_WORKBENCH.md +397 -0
  20. package/assets/generated/core/core/process/DEPLOYMENT_ENABLEMENT.md +166 -0
  21. package/assets/generated/core/core/process/GUIDED_NEXT_STEPS.md +48 -0
  22. package/assets/generated/core/core/process/HUMAN_GATES.md +83 -0
  23. package/assets/generated/core/core/process/INTERACTIVE_SESSION_GUIDE.md +64 -0
  24. package/assets/generated/core/core/process/PROJECT_DOCUMENTATION_FRAMEWORK.md +326 -0
  25. package/assets/generated/core/core/process/PROJECT_FORGE_ENGINEERING_GUIDE.md +308 -0
  26. package/assets/generated/core/core/process/PR_WORKFLOW.md +55 -0
  27. package/assets/generated/core/core/process/SETUP_ACCEPTANCE_CHECKLIST.md +72 -0
  28. package/assets/generated/core/core/process/SYSTEM_DESIGN_LEARNING_WORKBENCH.md +520 -0
  29. package/assets/generated/core/core/process/WORK_ITEM_MODEL.md +56 -0
  30. package/assets/generated/core/core/skills/cleanup-branches/SKILL.md +190 -0
  31. package/assets/generated/core/core/skills/coach/SKILL.md +174 -0
  32. package/assets/generated/core/core/skills/code-walkthrough/SKILL.md +197 -0
  33. package/assets/generated/core/core/skills/core-sync/SKILL.md +178 -0
  34. package/assets/generated/core/core/skills/db-lab/SKILL.md +245 -0
  35. package/assets/generated/core/core/skills/define-feature/SKILL.md +144 -0
  36. package/assets/generated/core/core/skills/deliver/SKILL.md +397 -0
  37. package/assets/generated/core/core/skills/deploy/SKILL.md +188 -0
  38. package/assets/generated/core/core/skills/deployment-readiness/SKILL.md +234 -0
  39. package/assets/generated/core/core/skills/developer-env-mode/SKILL.md +231 -0
  40. package/assets/generated/core/core/skills/docs/SKILL.md +116 -0
  41. package/assets/generated/core/core/skills/grill-me/SKILL.md +77 -0
  42. package/assets/generated/core/core/skills/grill-with-docs/SKILL.md +90 -0
  43. package/assets/generated/core/core/skills/learning-review/SKILL.md +90 -0
  44. package/assets/generated/core/core/skills/next-step/SKILL.md +221 -0
  45. package/assets/generated/core/core/skills/progress/SKILL.md +207 -0
  46. package/assets/generated/core/core/skills/project-forge-update/SKILL.md +228 -0
  47. package/assets/generated/core/core/skills/pull-latest/SKILL.md +166 -0
  48. package/assets/generated/core/core/skills/refine-requirements/SKILL.md +207 -0
  49. package/assets/generated/core/core/skills/setup/SKILL.md +362 -0
  50. package/assets/generated/core/core/skills/start-work/SKILL.md +190 -0
  51. package/assets/generated/core/core/skills/system-lab/SKILL.md +333 -0
  52. package/assets/generated/core/core/skills/tear-down/SKILL.md +140 -0
  53. package/assets/generated/core/core/skills/upstream-fix/SKILL.md +221 -0
  54. package/assets/generated/core/core/skills/wait-what/SKILL.md +86 -0
  55. package/assets/generated/core/core/templates/ADR_TEMPLATE.md +41 -0
  56. package/assets/generated/core/core/templates/FEATURE_BRIEF_TEMPLATE.md +27 -0
  57. package/assets/generated/core/core/templates/PRODUCT_BRIEF_TEMPLATE.md +27 -0
  58. package/assets/generated/core/core/templates/PULL_REQUEST_TEMPLATE.md +37 -0
  59. package/assets/generated/core/core/templates/REQUIREMENTS_TEMPLATE.md +17 -0
  60. package/assets/generated/core/profiles/greenfield/project-forge-workspace.json +12 -0
  61. package/assets/generated/core/tools/db_lab/sqlite_workbench.py +463 -0
  62. package/assets/generated/core/tools/docs_site/docs_site.py +512 -0
  63. package/assets/generated/core/tools/package/check_baseline.py +102 -0
  64. package/assets/generated/core/tools/package/check_upstream.py +171 -0
  65. package/assets/generated/core/tools/system_lab/system_workbench.py +243 -0
  66. package/assets/generated/deployment/distribution/project-forge-deploy.py +8 -0
  67. package/assets/generated/deployment/docs/DEVELOPER_ENVIRONMENTS.md +335 -0
  68. package/assets/generated/deployment/docs/ENVIRONMENT_PROOF.md +95 -0
  69. package/assets/generated/deployment/docs/WORKSPACE_INSTANCES.md +154 -0
  70. package/assets/generated/deployment/docs/images/developer-environment-journey.svg +56 -0
  71. package/assets/generated/deployment/docs/images/personal-environment-architecture.svg +54 -0
  72. package/assets/generated/deployment/docs/images/poc-environment-model.svg +61 -0
  73. package/assets/generated/deployment/src/project_forge_deployment/__init__.py +3 -0
  74. package/assets/generated/deployment/src/project_forge_deployment/__main__.py +3 -0
  75. package/assets/generated/deployment/src/project_forge_deployment/app_cli.py +163 -0
  76. package/assets/generated/deployment/src/project_forge_deployment/app_runtime.py +455 -0
  77. package/assets/generated/deployment/src/project_forge_deployment/app_runtime_remote.py +416 -0
  78. package/assets/generated/deployment/src/project_forge_deployment/app_runtime_workstation.py +136 -0
  79. package/assets/generated/deployment/src/project_forge_deployment/box_platform.py +208 -0
  80. package/assets/generated/deployment/src/project_forge_deployment/box_platform_assets.py +100 -0
  81. package/assets/generated/deployment/src/project_forge_deployment/box_platform_remote.py +271 -0
  82. package/assets/generated/deployment/src/project_forge_deployment/cli.py +437 -0
  83. package/assets/generated/deployment/src/project_forge_deployment/doctor.py +121 -0
  84. package/assets/generated/deployment/src/project_forge_deployment/entrypoint.py +37 -0
  85. package/assets/generated/deployment/src/project_forge_deployment/environment_cli.py +271 -0
  86. package/assets/generated/deployment/src/project_forge_deployment/environment_probe.py +228 -0
  87. package/assets/generated/deployment/src/project_forge_deployment/errors.py +5 -0
  88. package/assets/generated/deployment/src/project_forge_deployment/home_lab.py +328 -0
  89. package/assets/generated/deployment/src/project_forge_deployment/image_transfer.py +105 -0
  90. package/assets/generated/deployment/src/project_forge_deployment/keys.py +171 -0
  91. package/assets/generated/deployment/src/project_forge_deployment/local_cli.py +189 -0
  92. package/assets/generated/deployment/src/project_forge_deployment/local_runtime.py +526 -0
  93. package/assets/generated/deployment/src/project_forge_deployment/local_spec.py +82 -0
  94. package/assets/generated/deployment/src/project_forge_deployment/local_sqlite.py +205 -0
  95. package/assets/generated/deployment/src/project_forge_deployment/portable_profile.py +181 -0
  96. package/assets/generated/deployment/src/project_forge_deployment/profile_migration.py +70 -0
  97. package/assets/generated/deployment/src/project_forge_deployment/profile_repository.py +348 -0
  98. package/assets/generated/deployment/src/project_forge_deployment/profiles.py +204 -0
  99. package/assets/generated/deployment/src/project_forge_deployment/registry_access.py +114 -0
  100. package/assets/generated/deployment/src/project_forge_deployment/registry_cli.py +51 -0
  101. package/assets/generated/deployment/src/project_forge_deployment/route_registry.py +367 -0
  102. package/assets/generated/deployment/src/project_forge_deployment/route_registry_remote.py +443 -0
  103. package/assets/generated/deployment/src/project_forge_deployment/security.py +290 -0
  104. package/assets/generated/deployment/src/project_forge_deployment/sqlite_adapter.py +335 -0
  105. package/assets/generated/deployment/src/project_forge_deployment/sqlite_adapter_remote.py +340 -0
  106. package/assets/generated/deployment/src/project_forge_deployment/sqlite_cli.py +86 -0
  107. package/assets/generated/deployment/src/project_forge_deployment/sqlite_import_recovery.py +437 -0
  108. package/assets/generated/deployment/src/project_forge_deployment/ssh.py +119 -0
  109. package/assets/generated/deployment/src/project_forge_deployment/teardown.py +300 -0
  110. package/assets/generated/deployment/src/project_forge_deployment/teardown_cli.py +139 -0
  111. package/assets/generated/deployment/src/project_forge_deployment/teardown_remote.py +100 -0
  112. package/assets/generated/deployment/src/project_forge_deployment/trust.py +278 -0
  113. package/bin/project-forge.mjs +9 -0
  114. package/package.json +33 -6
  115. package/src/cli.mjs +150 -0
  116. package/src/engine.mjs +243 -0
  117. package/src/package-data.mjs +18 -0
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: project-forge-update
3
+ description: Guided whole-profile update for package-managed Project Forge consumers using the exact published @mriekki/project-forge artifact while preserving Core, Deployment, umbrella, and generated-consumer provenance integrity.
4
+ argument-hint: "[optional exact package version]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Project Forge Update
10
+
11
+ `/project-forge-update` is the normal update workflow for consumers that contain `PROJECT_FORGE_BASELINE.json` and were installed/generated from the public Project Forge package.
12
+
13
+ The governing rule is:
14
+
15
+ ```text
16
+ package-managed consumer
17
+ → update the whole Project Forge profile through the published package
18
+ → keep PROJECT_FORGE_BASELINE.json + component baselines coherent
19
+ → when the consumer is Bootstrap-generated, keep approved generation metadata and generated package-verification surfaces coherent too
20
+ ```
21
+
22
+ Do not replace this with direct Core-only or Deployment-Kit-only synchronization when `PROJECT_FORGE_BASELINE.json` is present.
23
+
24
+ Invocation starts read-only. One explicit update choice may authorize safe branch setup plus the exact package apply, generated-consumer companion metadata updates when applicable, and verification. `/deliver`, merge, release publication, and production deployment remain separate.
25
+
26
+ ## 1. Establish package-managed provenance
27
+
28
+ From the consumer root read:
29
+
30
+ - `PROJECT_FORGE_BASELINE.json`;
31
+ - `CORE_BASELINE.json` when present;
32
+ - `DEPLOYMENT_BASELINE.json` when present;
33
+ - `POC_BOOTSTRAP.json` when present;
34
+ - current Git status, branch, remotes, and default branch when observable.
35
+
36
+ Require `PROJECT_FORGE_BASELINE.json` to identify:
37
+
38
+ - package name;
39
+ - installed package version;
40
+ - profile;
41
+ - recorded Core component commit/version/distribution;
42
+ - recorded Deployment component commit/distribution when that component is present.
43
+
44
+ If `PROJECT_FORGE_BASELINE.json` is absent, report `NOT A PACKAGE-MANAGED PROJECT FORGE CONSUMER` and stop. A Core-only consumer may use `/core-sync`; another component-only consumer must use that component's canonical component update path.
45
+
46
+ Do not synthesize or repair missing umbrella provenance by hand.
47
+
48
+ ### Bootstrap-generated consumers
49
+
50
+ If `POC_BOOTSTRAP.json` exists, treat it as approved generated-consumer provenance, not unrelated product data.
51
+
52
+ Before planning an update, require `generation.projectForge.package`, `generation.projectForge.version`, and `generation.projectForge.profile` to agree exactly with the installed `PROJECT_FORGE_BASELINE.json`. Require `generation.projectForge.integrity` to be a non-empty exact registry integrity value for that installed package/version. Verify that integrity read-only from the registry when registry access is available.
53
+
54
+ If those values disagree before the update, report `GENERATED PROJECT FORGE METADATA DRIFT` and stop. Do not use `/project-forge-update` to silently reconcile an already-incoherent generated consumer.
55
+
56
+ Also inspect generated package-verification surfaces such as `.github/workflows/ci.yml` when present. If they duplicate the approved package version/integrity literally, record that current shape as companion generated metadata that must remain coherent with `POC_BOOTSTRAP.json` during the update. Do not rewrite locally customized or unrecognized generated surfaces by guesswork.
57
+
58
+ ## 2. Verify the installed package baseline first
59
+
60
+ Before planning an update, verify that the current managed state still matches the exact installed package version recorded in `PROJECT_FORGE_BASELINE.json`.
61
+
62
+ For the standard package this is equivalent to:
63
+
64
+ ```text
65
+ npx --yes @mriekki/project-forge@<installed-version> check
66
+ ```
67
+
68
+ Use the package identity recorded by the baseline rather than silently substituting another package.
69
+
70
+ If the exact installed package cannot be obtained, or `check` reports stale/drifted Core, Deployment, or umbrella metadata, stop. Do not use an update as a way to overwrite unexplained managed drift.
71
+
72
+ Also inspect Git state. Preserve unrelated consumer work; never auto-stash, reset, clean, rebase, force-update, or discard it.
73
+
74
+ ## 3. Resolve one exact target package
75
+
76
+ If the human supplied an exact version, use that exact version after confirming it exists.
77
+
78
+ Otherwise resolve the registry's current published version first, then pin that exact value for the remainder of the operation. For the standard package, typical read-only evidence is:
79
+
80
+ ```text
81
+ npm view @mriekki/project-forge@latest version --json
82
+ npm view @mriekki/project-forge@<resolved-version> dist.integrity --json
83
+ ```
84
+
85
+ Capture the target package's full exact `dist.integrity` together with the resolved version. For a Bootstrap-generated consumer, that exact integrity is part of the reviewed companion metadata update.
86
+
87
+ Do not use a moving `@latest` reference for the modifying apply after preview. Use the same exact package version for preview, apply, and final check.
88
+
89
+ If the resolved version equals the installed version and the exact-version check passes, report `PROJECT FORGE ALREADY CURRENT` and stop without creating a branch or commit.
90
+
91
+ If the resolved target is semantically older than the installed package, report `PROJECT FORGE DOWNGRADE REQUESTED` and stop. Normal `/project-forge-update` does not authorize a downgrade or rollback; that requires a separate explicit recovery/rollback decision with repository-specific evidence.
92
+
93
+ ## 4. Preview the whole-profile update
94
+
95
+ Run the target package's update command without `--apply` and inspect the complete plan. For the standard package:
96
+
97
+ ```text
98
+ npx --yes @mriekki/project-forge@<target-version> update
99
+ ```
100
+
101
+ Do not approve the package's interactive apply prompt during preview. When needed, invoke preview in the environment's non-interactive/read-only form so the printed plan is observed without applying it.
102
+
103
+ The preview must cover every component in the installed profile together. A managed conflict/drift in any component blocks the whole update.
104
+
105
+ Stop on unsafe states such as:
106
+
107
+ - `LOCAL_DRIFT`;
108
+ - `CONFLICT`;
109
+ - `LOCAL_MISSING`;
110
+ - `UNTRACKED_CONFLICT`;
111
+ - path collisions/conflicts;
112
+ - Core `RETIRED_DRIFT` when the retired file no longer matches its recorded managed hash.
113
+
114
+ A package-managed retired path that is unchanged from its recorded baseline may be classified as `REMOVE` and deleted safely; an already-missing retired path may be classified as `RETIRED_MISSING`. These states do not require a separate ownership decision because the baseline proves there is no consumer edit to preserve.
115
+
116
+ A modified retired Core path is different: never auto-add `--accept-retired core:<path>` merely to make the update pass. Explain that the file differs from its recorded Core-managed hash and require a separate explicit ownership-transfer decision before re-previewing it. When that exact transfer is accepted, the package updater preserves the file as consumer-owned content and drops it from the new Core baseline.
117
+
118
+ For a Bootstrap-generated consumer, also preview the companion generated-consumer changes:
119
+
120
+ - `POC_BOOTSTRAP.json` keeps the same package/profile but changes `generation.projectForge.version` and `generation.projectForge.integrity` to the exact reviewed target;
121
+ - generated package-verification surfaces should consume `POC_BOOTSTRAP.json` dynamically when the accepted Bootstrap contract supports that form;
122
+ - a recognized older Bootstrap-generated verification block may be migrated only when its embedded old package/version/integrity exactly match the currently approved manifest metadata;
123
+ - an unrecognized or locally modified generated verification surface is a stop condition, not permission to reconstruct Bootstrap output by hand.
124
+
125
+ ## 5. Present one bounded update choice
126
+
127
+ When the exact target package plan and any generated-consumer companion plan are safe, present:
128
+
129
+ ```text
130
+ PROJECT FORGE UPDATE READY
131
+
132
+ Installed: <package>@<installed-version>
133
+ Target: <package>@<target-version>
134
+ Target integrity: <exact dist.integrity>
135
+ Profile: <profile>
136
+ Core: <old> → <new>
137
+ Deployment: <old> → <new> / unchanged
138
+ Generated consumer metadata: <not present / coherent update planned>
139
+ Managed drift/conflicts: NONE
140
+
141
+ 1. Apply the exact Project Forge package update [GIT + FILE WRITE] — recommended
142
+ 2. Keep inspecting only [READ ONLY]
143
+ 3. Stop [NO ACTION]
144
+ ```
145
+
146
+ Choosing option 1 authorizes only:
147
+
148
+ - creation/switch to one repository-appropriate short-lived update branch when needed;
149
+ - exact target package apply;
150
+ - removal of unchanged retired package-managed files that the reviewed preview classified as `REMOVE`;
151
+ - when `POC_BOOTSTRAP.json` is present, update of its exact `generation.projectForge.version` and `generation.projectForge.integrity` to the reviewed target while preserving package/profile;
152
+ - migration of a recognized Bootstrap-generated package-verification block from duplicated current literals to the accepted manifest-driven form, only when the existing block still exactly matches the current approved metadata;
153
+ - package/baseline/generated-consumer verification;
154
+ - inspection of the resulting meaningful diff.
155
+
156
+ It does not authorize `/deliver`, merge, npm/Core/Deployment/Bootstrap release publication, arbitrary regeneration, or deployment.
157
+
158
+ ## 6. Apply only the exact previewed package
159
+
160
+ If the consumer is on its default branch, create/switch to a short-lived branch such as:
161
+
162
+ ```text
163
+ chore/update-project-forge-<target-version>
164
+ ```
165
+
166
+ Branch setup is routine inside the selected bounded update action when safe and unambiguous.
167
+
168
+ Apply using the same exact package version that was previewed, for example:
169
+
170
+ ```text
171
+ npx --yes @mriekki/project-forge@<target-version> update --apply
172
+ ```
173
+
174
+ If explicit Core retired-path ownership transfer was separately approved, pass only the exact reviewed modified paths using the package's `--accept-retired core:<path>` contract. Never widen that set implicitly. Unchanged retired managed paths do not need this flag; the package updater removes them according to the reviewed `REMOVE` plan.
175
+
176
+ For a Bootstrap-generated consumer, complete the reviewed companion metadata changes in the same bounded update before declaring success. Preserve every unrelated `POC_BOOTSTRAP.json` field. Never change package identity or profile as an incidental version update.
177
+
178
+ Do not run direct `tools/package/sync.py`, Deployment Kit sync, or a remote `[sync-core]` request as part of a package-managed update.
179
+
180
+ ## 7. Verify all baselines, generated metadata, and the diff
181
+
182
+ After apply, run the exact target package check:
183
+
184
+ ```text
185
+ npx --yes @mriekki/project-forge@<target-version> check
186
+ ```
187
+
188
+ Then inspect:
189
+
190
+ ```text
191
+ git status --short --branch
192
+ git diff --stat
193
+ git diff -- PROJECT_FORGE_BASELINE.json CORE_BASELINE.json DEPLOYMENT_BASELINE.json POC_BOOTSTRAP.json .github/workflows/ci.yml
194
+ ```
195
+
196
+ Confirm:
197
+
198
+ - `PROJECT_FORGE_BASELINE.json` records the exact target package/version/profile;
199
+ - component baseline commits/distributions match the umbrella baseline;
200
+ - package check passes for the whole profile;
201
+ - unchanged retired managed files shown as `REMOVE` in the preview are actually absent after apply, while any explicitly transferred modified retired Core file remains present and is no longer Core-managed;
202
+ - when `POC_BOOTSTRAP.json` exists, its package/version/profile agree with `PROJECT_FORGE_BASELINE.json` and its integrity equals the exact reviewed target registry integrity;
203
+ - when the repository contains `tools/project-forge-package/check-managed-baselines.py`, that generated baseline checker passes after all companion metadata changes;
204
+ - generated package-verification surfaces no longer contradict the approved manifest metadata;
205
+ - consumer-owned content was not overwritten;
206
+ - only intended package-managed changes, reviewed generated-consumer companion changes, reviewed removals, and reviewed ownership transfers occurred.
207
+
208
+ If generated CI still embeds a different package version/integrity after the update, report `GENERATED PROJECT FORGE VERIFICATION DRIFT` and stop before delivery.
209
+
210
+ Present the meaningful diff for human review. After acceptance, recommend `/deliver` for normal commit/push/PR/CI mechanics.
211
+
212
+ ## 8. Boundaries
213
+
214
+ `/project-forge-update` never:
215
+
216
+ - updates only Core or only Deployment when `PROJECT_FORGE_BASELINE.json` manages them together;
217
+ - uses a different package version for apply than the reviewed preview;
218
+ - performs a downgrade/rollback as an ordinary update;
219
+ - overwrites unexplained managed drift;
220
+ - auto-accepts Core retired-path ownership transfer for a modified retired file;
221
+ - silently repairs a pre-existing mismatch between `POC_BOOTSTRAP.json` and `PROJECT_FORGE_BASELINE.json`;
222
+ - changes a generated consumer's package identity/profile or regenerates the repository as an incidental version update;
223
+ - guesses at locally modified/unrecognized Bootstrap-generated verification logic;
224
+ - publishes npm/Core/Deployment/Bootstrap releases or tags;
225
+ - merges the consumer PR;
226
+ - deploys an environment.
227
+
228
+ If reusable shared content is wrong rather than merely outdated, route the defect through `/upstream-fix` first. Package-managed adoption of the accepted fix happens only after an accepted Project Forge package release contains that upstream commit.
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: pull-latest
3
+ description: Guided fast-forward-only Git update so a developer can safely get the latest remote branch state without remembering Git syntax.
4
+ argument-hint: "[optional branch name]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Pull Latest
10
+
11
+ `/pull-latest` is a small convenience wrapper for routine Git updates. It removes the need to remember `fetch`, `switch`, `pull --ff-only`, or upstream-status syntax while preserving normal repository safety.
12
+
13
+ Existing repository conventions outrank Project Forge defaults.
14
+
15
+ Invocation starts read-only.
16
+
17
+ ## 1. Inspect current state
18
+
19
+ Inspect:
20
+
21
+ ```text
22
+ git status --short --branch
23
+ git branch --show-current
24
+ git remote -v
25
+ git branch -vv
26
+ ```
27
+
28
+ Resolve:
29
+ - current branch,
30
+ - configured upstream for the current branch,
31
+ - configured default branch when observable,
32
+ - requested branch when one was supplied,
33
+ - whether the working tree is clean enough to switch/update safely.
34
+
35
+ Do not fetch, switch branches, pull, stash, merge, rebase, reset, clean, or delete anything during this first inspection.
36
+
37
+ ## 2. Safety stop conditions
38
+
39
+ Stop before update when:
40
+ - tracked/staged/untracked work could be overwritten or makes branch switching unsafe,
41
+ - a merge/rebase/cherry-pick is in progress,
42
+ - the requested branch or remote is ambiguous,
43
+ - no usable upstream exists for the branch being updated,
44
+ - authentication/remote access fails,
45
+ - repository policy requires a different update method.
46
+
47
+ Never auto-stash user work.
48
+ Never use `reset --hard`, force-push, merge, or rebase as part of `/pull-latest`.
49
+
50
+ ## 3. Choose the update target
51
+
52
+ If the human supplied a branch, use that branch as the requested target when it can be resolved safely.
53
+
54
+ If no branch was supplied and the current branch is the default branch, present:
55
+
56
+ ```text
57
+ PULL LATEST READY
58
+
59
+ Current branch: <branch>
60
+ Working tree: CLEAN
61
+
62
+ 1. Refresh remote state and pull latest <branch> [GIT WRITE] — recommended
63
+ 2. Stop [NO ACTION]
64
+ ```
65
+
66
+ If no branch was supplied and the current branch is a non-default branch, present:
67
+
68
+ ```text
69
+ PULL LATEST READY
70
+
71
+ Current branch: <branch>
72
+ Default branch: <default>
73
+ Working tree: CLEAN
74
+
75
+ 1. Refresh and pull the current branch [GIT WRITE]
76
+ 2. Switch to the default branch and pull latest [GIT WRITE] — recommended for returning to baseline
77
+ 3. Stop [NO ACTION]
78
+ ```
79
+
80
+ Only the selected option authorizes fetch/switch/pull mechanics for the selected branch.
81
+
82
+ ## 4. Refresh remote state
83
+
84
+ For the selected remote/branch, run the repository-normal equivalent of:
85
+
86
+ ```text
87
+ git fetch <remote> --prune
88
+ ```
89
+
90
+ Then re-evaluate local branch, upstream, and remote head before pulling.
91
+
92
+ Classify the branch as:
93
+ - `CURRENT` — local and upstream point to the same commit,
94
+ - `BEHIND` — local can be fast-forwarded to upstream,
95
+ - `AHEAD` — local has commits not on upstream,
96
+ - `DIVERGED` — both local and upstream contain unique commits,
97
+ - `UNKNOWN` — state cannot be established safely.
98
+
99
+ ## 5. Apply only a fast-forward-safe update
100
+
101
+ ### CURRENT
102
+
103
+ Do not create a no-op commit or other change. Report that the branch is already current.
104
+
105
+ ### BEHIND
106
+
107
+ Use the repository-normal equivalent of:
108
+
109
+ ```text
110
+ git pull --ff-only
111
+ ```
112
+
113
+ If the user selected the default branch while currently on another branch, first switch to the existing local default branch only after confirming the working tree is safe, then perform the same fast-forward-only update.
114
+
115
+ ### AHEAD
116
+
117
+ Do not pull, merge, rebase, reset, or push. Report `LOCAL AHEAD` and the observed commit counts when available.
118
+
119
+ ### DIVERGED
120
+
121
+ Stop. Report `DIVERGED` and recommend explicit inspection. `/pull-latest` must not choose merge, rebase, reset, or force-push on the user's behalf.
122
+
123
+ ### UNKNOWN
124
+
125
+ Stop and report the missing/ambiguous evidence.
126
+
127
+ ## 6. Verification
128
+
129
+ After a successful update, inspect:
130
+
131
+ ```text
132
+ git status --short --branch
133
+ git log -1 --oneline
134
+ ```
135
+
136
+ When useful, also confirm the local branch head matches its upstream.
137
+
138
+ ## 7. Completion report
139
+
140
+ Use:
141
+
142
+ ```text
143
+ PULL LATEST COMPLETE
144
+
145
+ Branch: <branch>
146
+ Remote/upstream: <remote>/<branch>
147
+ Result: UPDATED | ALREADY CURRENT | LOCAL AHEAD | DIVERGED | BLOCKED
148
+ Head: <sha>
149
+ Working tree: <state>
150
+ ```
151
+
152
+ Do not claim an update succeeded unless the resulting branch/upstream state was observed.
153
+
154
+ ## 8. Boundaries
155
+
156
+ `/pull-latest` never:
157
+ - modifies application/source files directly,
158
+ - stashes work automatically,
159
+ - creates or deletes branches,
160
+ - commits or pushes,
161
+ - merges or rebases,
162
+ - resets or cleans the worktree,
163
+ - resolves conflicts automatically,
164
+ - changes remotes/upstreams unless a separate explicit action authorizes that configuration change.
165
+
166
+ It is intentionally just the safe convenience path for `refresh remote state → fast-forward if possible → verify`.
@@ -0,0 +1,207 @@
1
+ ---
2
+ name: refine-requirements
3
+ description: Assess and continuously refine requirement coverage for the configured authoritative work-item source without forcing a local requirements hierarchy.
4
+ argument-hint: "<work-item ID, external key, or topic>"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Refine Requirements
10
+
11
+ Purpose: make requirements implementation-ready when the work benefits from detailed precision.
12
+
13
+ This skill is proportional; it is not mandatory for every change.
14
+
15
+ ## 1. Resolve authority and context
16
+
17
+ Read `.github/project-forge-workspace.json` when present.
18
+
19
+ Determine:
20
+ - authoritative work-item source,
21
+ - parent/grouping context when actually available,
22
+ - permitted Product/Feature Brief roles,
23
+ - whether local detailed requirements are authoritative, supplemental, read-only, or not used,
24
+ - relevant accepted ADR/design rules.
25
+
26
+ Read only the minimum relevant context. Do not preload unrelated work items. Do not claim external content was read unless it is actually available.
27
+
28
+ Never assume `Jira Epic == Feature Brief`.
29
+
30
+ ## 2. Decide whether detail is warranted
31
+
32
+ Detailed refinement is useful for behavior such as:
33
+ - lifecycle/state transitions,
34
+ - archive/delete/restore,
35
+ - validation/uniqueness,
36
+ - identity/permissions/attribution,
37
+ - data integrity,
38
+ - concurrency/transactions,
39
+ - destructive/reversible behavior,
40
+ - failure handling,
41
+ - multiple related workflows,
42
+ - cross-layer behavior needing testable boundaries.
43
+
44
+ For LIGHT/obvious work, say detailed refinement is unnecessary and return to `/start-work`.
45
+
46
+ ## 3. Requirement shape depends on authority
47
+
48
+ ### Local combined requirements permitted
49
+
50
+ Prefer one combined file rather than separate user-story/domain files.
51
+
52
+ Product Feature:
53
+
54
+ ```text
55
+ requirements.md
56
+ ├── User Stories
57
+ ├── Domain Requirements
58
+ ├── Acceptance / Validation Scenarios
59
+ ├── Open Decisions
60
+ ├── Traceability
61
+ └── Approval
62
+ ```
63
+
64
+ Engineering Enabler:
65
+
66
+ ```text
67
+ requirements.md
68
+ ├── Engineering Requirements
69
+ ├── Acceptance Criteria / Validation Scenarios
70
+ ├── Open Decisions
71
+ ├── Traceability
72
+ └── Approval
73
+ ```
74
+
75
+ Do not invent personas for technical enablers.
76
+
77
+ ### External work item is primary
78
+
79
+ If Jira/Issue/another external system is primary and local detailed requirements are not an approved supplement:
80
+ - assess the external content actually provided/accessible,
81
+ - maintain concise proposed external-work-item updates during the session,
82
+ - do not create `requirements.md` merely as a dumping ground.
83
+
84
+ ## 4. Initial behavior is read-only
85
+
86
+ Report an evidence-backed coverage assessment first:
87
+
88
+ ```text
89
+ REQUIREMENTS COVERAGE
90
+
91
+ User / engineering outcomes:
92
+ ✓ ...
93
+ ○ ...
94
+
95
+ Domain / engineering rules:
96
+ ✓ ...
97
+ ○ ...
98
+
99
+ Acceptance / validation:
100
+ ✓ ...
101
+ ○ ...
102
+
103
+ Cross-work-item/grouping context:
104
+ ✓ / ○ / N/A
105
+
106
+ Open material decisions:
107
+ - ...
108
+
109
+ AUTHORITATIVE SOURCE
110
+ <source>
111
+
112
+ STATUS
113
+ <DRAFT / APPROVED / external status / not represented locally>
114
+ ```
115
+
116
+ Then present only relevant choices, for example:
117
+
118
+ ```text
119
+ 1. Review outcomes [READ ONLY]
120
+ 2. Review rules [READ ONLY]
121
+ 3. Review acceptance scenarios [READ ONLY]
122
+ 4. Refine identified gaps [MODIFIES DOCS or PROPOSED EXTERNAL UPDATE]
123
+ 5. Grill an unresolved decision [READ ONLY]
124
+ 6. Review full requirements/work item [READ ONLY]
125
+ 7. Approve local requirements when applicable [REQUIREMENTS GATE]
126
+ 8. Stop [NO ACTION]
127
+ ```
128
+
129
+ ## 5. Active refinement session
130
+
131
+ Once the human selects a modifying refinement option, enter a bounded continuous session:
132
+
133
+ ```text
134
+ ask one material requirement question
135
+ → human answers
136
+ → reconcile/update/propose only what was resolved
137
+ → update directly affected validation scenario when useful
138
+ → summarize exactly what changed
139
+ → next material question
140
+ ```
141
+
142
+ For bounded requirement decisions such as lifecycle policy, validation behavior, destructive/reversible handling, or a small set of credible alternatives, use the choice-first interaction guidance from `INTERACTIVE_SESSION_GUIDE.md`. Keep outcome wording, workflow descriptions, acceptance intent, and other human-authored framing open-ended when predefined choices would constrain the requirement.
143
+
144
+ Do not ask after each answer whether to update.
145
+
146
+ For local combined requirements:
147
+ - preserve stable IDs,
148
+ - do not renumber approved IDs,
149
+ - keep implementation convenience out unless it is itself an approved requirement.
150
+
151
+ For external-primary requirements without write authorization:
152
+ - accumulate `PROPOSED EXTERNAL WORK-ITEM UPDATES`.
153
+
154
+ If a permitted external write integration exists, require explicit `[EXTERNAL WRITE]` authorization before applying those updates.
155
+
156
+ ## 6. Pause only for material conflicts
157
+
158
+ Stop automatic reconciliation when an answer would:
159
+ - materially change approved higher-level scope,
160
+ - contradict an approved Product/Feature/Enabler rule,
161
+ - contradict an accepted ADR/design decision,
162
+ - require a cross-cutting architecture decision,
163
+ - remain too ambiguous to record faithfully.
164
+
165
+ Then present a small explicit choice.
166
+
167
+ ## 7. Approval gate
168
+
169
+ Local detailed requirements use only meaningful authoring states:
170
+
171
+ ```text
172
+ DRAFT
173
+ APPROVED
174
+ ```
175
+
176
+ Human approval is explicit. Do not infer approval from review/planning/implementation.
177
+
178
+ Before approval report coverage and open material decisions. Only an explicit `[REQUIREMENTS GATE]` choice may change local status to `APPROVED`.
179
+
180
+ External work-item status/approval follows the external team's conventions; Project Forge must not fabricate a local approval state.
181
+
182
+ ## 8. Natural completion
183
+
184
+ Summarize:
185
+
186
+ ```text
187
+ REQUIREMENTS REFINEMENT COMPLETE
188
+
189
+ Updated/proposed:
190
+ - <outcomes>
191
+ - <rules>
192
+ - <acceptance scenarios>
193
+
194
+ Open material decisions:
195
+ None / list
196
+
197
+ Authority/status:
198
+ <source and status>
199
+ ```
200
+
201
+ Then offer review, more grilling/refinement, approval when applicable, or stop.
202
+
203
+ ## 9. Stop boundary
204
+
205
+ Do not create implementation plans or production code.
206
+
207
+ When requirements are ready, recommend `/start-work <ID-or-key>`.