speckit-companion-before-step
Skill0 starsChanged 49 days agoMITView on GitHub
Capture a spec-kit step's start into .spec-context.json for the Companion GUI
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- monicahq/monicaedited, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- monicahq/monica★ 26k38% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- speckit-analyzeSkill
- speckit-assess-decideSkill
- speckit-assess-defineSkill
- speckit-assess-intakeSkill
- speckit-assess-researchSkill
- speckit-assess-shapeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-companion-after-convergeSkill
- speckit-companion-after-implementSkill
- speckit-companion-after-planSkill
- speckit-companion-after-specifySkill
- speckit-companion-after-tasksSkill
- speckit-companion-autoSkill
- speckit-companion-before-convergeSkill
- speckit-companion-classifySkill
- speckit-companion-doctorSkill
- speckit-companion-implementSkill
- speckit-companion-living-adoptSkill
- speckit-companion-living-coverageSkill
- speckit-companion-living-driftSkill
- speckit-companion-living-moveSkill
- speckit-companion-living-showSkill
- speckit-companion-living-syncSkill
- speckit-companion-living-validateSkill
- speckit-companion-mark-completeSkill
- speckit-companion-planSkill
- speckit-companion-resumeSkill
- speckit-companion-specifySkill
- speckit-companion-statusSkill
- speckit-companion-tasksSkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Verify Python is available by running python3 --version.
- Very specific: line 17
If python3 is not available, warn the user and skip the capture: [companion] Warning: python3 not detected.
- Distinctive: line 23
Plan, tasks or implement: Run the writer script from the repository root with that step's values:
- Very specific: line 37
Specify: Do not run the writer. The new feature directory does not exist yet, and .specify/feature.json still points at the previous spec, …
- Very specific: line 48
If python3 is missing, skip with the warning above.
- Distinctive: line 49
If the active feature directory cannot be resolved, the script prints a warning to stderr and exits 0 without writing.
- Very specific: line 50
If the spec is already completed or archived, nothing is written.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Capture Step Start
Record that the step you are about to run has started, so the SpecKit Companion GUI can time it. This command runs as the before_specify, before_plan, before_tasks and before_implement lifecycle hooks and only writes state; the step's work is the core speckit.* command that invoked it.
Prerequisites
- Verify Python is available by running
python3 --version. - If
python3is not available, warn the user and skip the capture:[companion] Warning: python3 not detected; skipped .spec-context.json capture. Do not fail the host command.
Execution
Which step is starting decides what to run.
Plan, tasks or implement. Run the writer script from the repository root with that step's values:
| Step | --step | --status |
| plan | plan | planning |
| tasks | tasks | tasking |
| implement | implement | implementing |
python3 .specify/extensions/companion/scripts/write-context.py --step <step> --status <status> --kind start --by extensionThe start is idempotent: when the GUI already recorded this step's start at dispatch, the call appends nothing and the earlier time stands.
Specify. Do not run the writer. The new feature directory does not exist yet, and .specify/feature.json still points at the previous spec, so a write now would land on finished work. Read the real clock and keep what it prints:
date -u +%Y-%m-%dT%H:%M:%SZOn PowerShell: (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"). The after_specify hook records it as the step's start once the directory exists. Never type a time yourself.
Graceful Degradation
The script is best-effort and never fails the host command:
- If
python3is missing, skip with the warning above. - If the active feature directory cannot be resolved, the script prints a warning to stderr and exits 0 without writing.
- If the spec is already
completedorarchived, nothing is written.
Output
On success the script prints the path it updated and the values written, e.g. [companion] Updated specs/<NNN>-<slug>/.spec-context.json (currentStep=plan, status=planning, kind=start, by=extension). The write is atomic and appends to history[] without rewriting existing entries.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

