task-context
Use to gather the context of a story key or a tracker id - its story, stream stage, scope screens, repositories, decisions, mockups and work records.
- License 许可
- MIT
- 最近更新
- 2026-10-30
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- task-context
- description
- Use to gather the context of a story key or a tracker id - its story, stream stage, scope screens, repositories, decisions, mockups and work records.
03 SKILL.md 正文
Task context
Steps
- Go to the workspace root: the nearest directory, walking up from where you are, where
test -f .agents/kit.jsonsucceeds. Run every later command in that directory. This skill changes no file. Readparams.languagefrom.agents/kit.json; when it is absent, useen. Below it is<lang>.- A value in
profile.jsonis either plain or a language object such as{"en": "Transitions", "ru": "Переходы"}. For a language object, take the value of<lang>, or the value ofenwhen<lang>is not in the object.
- A value in
- Ask the person for a story key or a tracker id, unless they already gave one. Below it is
<input>. - When
<input>starts withstory:, it is a story key of the formstory:<domain>/<slug>; go to step 4. Otherwise it is a tracker id<ID>. Check it:- Read
id_patternfromtracker/tracker.json. JSON doubles every backslash, so\\din the file means\d. - Rewrite the pattern for
grep -E: write every\das[0-9], becausegrep -Edoes not know\d. - Run
printf '%s\n' '<ID>' | grep -Ex '<rewritten pattern>'. The-xmakes the whole id match, not a part of it. - If it prints nothing, answer
<ID> is not in this workspaceand stop.
- Read
- Read
.agents/index.json. It is one JSON object that maps keys and tracker ids to paths. Take the value of<input>.- When there is no value, remember the line
index is stale: <input> is not in .agents/index.jsonand go to step 5. - When
test -f <value>fails, remember the lineindex is stale: .agents/index.json points <input> to <value>, which does not existand go to step 5. - For a story key, the value is the story path; go to step 6.
- For a tracker id, read the frontmatter
trackerof<value>and remove the quotes around it, if any. When it equals<ID>, the value is the story path; go to step 6. Otherwise remember the lineindex is stale: .agents/index.json points <input> to <value>, whose tracker is not <input>and go to step 5.
- When there is no value, remember the line
- Search the disk, because the index is stale. Add
2>/dev/nullto each command so that a glob with no match prints no error. Empty output, or only an error such asno matches foundorNo such file or directory, means nothing was found.- For a story key, run
ls domains/<domain>/streams/*/stories/<slug>/story.md 2>/dev/null. - For a tracker id, run
grep -lE "^tracker: [\"']?<ID>[\"']?$" domains/*/streams/*/stories/*/story.md 2>/dev/null. Quotes around the value are allowed in frontmatter. - When exactly one path is printed, that is the story path. Keep the "index is stale" line from step 4 for the report. The fix is
python3 tools/generate.py; this skill does not run it. - When more than one path is printed, report all of them, say that the index is stale and the id is used by more than one story, and stop.
- When nothing is found, answer
<input> is not in this workspaceand stop.
- For a story key, run
- Read the story file. The story path has the form
domains/<domain>/streams/<stream>/stories/<slug>/story.md; take<domain>,<stream>and<slug>from it. The story key isstory:<domain>/<slug>. Read its frontmatter:type,wave,tracker,scope,depends,repos,decisions,mockups. Remove the quotes aroundtracker, if any; use this bare value everywhere below. A list is written either askey: [a, b]or askey:followed by lines- a;key: []andkey:with nothing after it mean empty. - Read
domains/<domain>/streams/<stream>/stream.json. Takekey,profileandstage. When the file is missing, writestream.json missinginstead of the stage.- Find the summary section name: open
.agents/profiles/<profile>/profile.jsonand takestory.summary_section, resolved to<lang>as in step 1. Whenstory.summary_sectionis absent, take the first entry ofstory.sections, resolved the same way. This name is<section>. Forui-migrationit isGoalin an English workspace andЦельin a Russian workspace (params.languageisru). - Read the
## <section>section of the story and take its first non-empty line. When the section is absent, writeno <section> section. - When
stream.jsonis missing ortest -f .agents/profiles/<profile>/profile.jsonfails, writeno section name, stream.json missingorno section name, unknown profile <profile>instead of that line.
- Find the summary section name: open
- For each key in
scope, in order:- A key has the form
<prefix>:<element domain>/<element slug>. - Find the element entry: open
.agents/profiles/<profile>/profile.jsonand take the entry ofelementswhoseprefixequals<prefix>. Itsdirgives the pathdomains/<element domain>/<dir>/<element slug>.md, and itstableslist the tables to copy. Resolve each table'sheadingandcolumnsto<lang>as in step 1. - When there is no entry, the reason is one of:
stream.json missing(step 7 found no file),unknown profile <profile>(test -f .agents/profiles/<profile>/profile.jsonfails) orunknown prefix <prefix>(no entry has that prefix). Then:- For
screen:keys, use the pathdomains/<element domain>/map/<element slug>.md. For the table heading and columns, when.agents/profiles/<profile>/profile.jsonexists and has anelementsentry whosekindisscreen, take that entry's first table'sheadingandcolumns, resolved to<lang>as in step 1; otherwise useTransitionsfor the heading andAction,Targetfor the columns. For example, in a Russianui-migrationworkspace this heading isПереходы. Mark the keypath by convention: <reason>. - For any other prefix, write
<key>: no path, <reason>and take the next key. Do not look for its file or its transitions.
- For
- When
test -f <path>fails, writemissing: <path>for this key and take the next key. - Read the frontmatter values
kind,routeandlabelwhen present. - For each table, for example
Transitions, find the## <heading>section of the file and copy every row of its first table under the resolvedcolumns: forTransitions,ActionandTargetin an English workspace,ДействиеandЦельin a Russian workspace. When the section is absent, writeno <heading> section.
- A key has the form
- For each value in
repos, remove a leadingrepo:; the rest is<name>. Openrepos.jsonand find the entry ofrepositorieswhosenameequals<name>. Take itsstatus,remoteanddefault_branch. Aplannedrepository may have noremote; writeno remotethen, andstatus not setwhenstatusis absent. When there is no such entry, writenot in repos.json. Runls -d repos/<name> 2>/dev/nullto say whether a local clone exists; empty output means absent. - For each key
adr:<NNNN>indecisions, runls docs/adr/<NNNN>-*.md 2>/dev/null. Read the frontmattertitleandstatusof each printed file. When more than one file is printed, report every one and sayseveral ADR files share number <NNNN>. When nothing is printed, writemissing. - For each key in
mockups, opendocs/diagrams/external.jsonand find the entry ofdiagramswhosekeyequals it. Take itsurl. When there is no such entry, writenot in external.json. - When
trackeris not empty, runtest -f work/<tracker>/record.md. When it succeeds, read its title line and its frontmatterrepos,merge_requestsandcommits. Otherwise writeno work record. Whentrackeris empty, writeno tracker id. - Report in the format below. Name every item by its key and give paths relative to the workspace root. Write only what you read in steps 4 to 12; never guess a value, a path or a stage. Write
nonefor an empty list.
Report format
Story: <story key> (<story path>)
Tracker: <tracker without quotes, or "no tracker id">
Type: <type>; wave: <wave>; depends: <depends joined with ", " or "none">
Goal: <first line of the summary section from step 7>
Stream: <stream key> (<stream.json path>), profile <profile>, stage <stage>
Scope:
- <element key> (<element path>): kind <kind>; route <route>; label <label>[; path by convention: <reason>]
| <column> | <column> | ... |
|---|---| ... |
| <cell> | <cell> | ... |
- <element key>: no path, <reason>
Repositories:
- <name>: status <status>, remote <remote or "no remote">, default branch <default_branch>, clone <present or absent>
Decisions:
- <adr key> (<adr path>): <title>, <status>
Mockups:
- <mockup key>: <url>
Work record: <record path>, <title>; repos <repos or none>; commits <count>; merge requests <urls or none>
<the "index is stale" line from step 4, when the story was found in step 5>
Example for DEMO-145:
Story: story:operations/documents (domains/operations/streams/migration/stories/documents/story.md)
Tracker: DEMO-145
Type: story; wave: 2; depends: story:operations/login
Goal: Operators open and download client documents in the new interface.
Stream: stream:operations/migration (domains/operations/streams/migration/stream.json), profile ui-migration, stage decomposition
Scope:
- screen:operations/documents (domains/operations/map/documents.md): kind place; route /documents; label Documents
| Action | Target |
|---|---|
| Open document | screen:operations/document-view |
| Back | screen:operations/home |
Repositories:
- docs-bff: status active, remote git@example.org:ops/docs-bff.git, default branch main, clone present
Decisions:
- adr:0007 (docs/adr/0007-document-storage.md): Store documents in object storage, accepted
Mockups:
- mockup:operations/documents: https://design.example.org/file/documents
Work record: no work record
Example for an id nobody uses:
DEMO-999 is not in this workspace
Without Python
This skill needs no Python. It only reads files and changes none, so there is nothing to check.
04 同仓库更多 Skills
verify
Use when a change in __SERVICE__ must be checked before review
work-record
Use when you finished work on a tracker task and it must be recorded in the workspace through a merge request.
task-new
Use to create one story in a stream from the stream profile's story template, link it from its scope screens and open a merge request.
task-decompose
Use to split a stream at the decomposition stage into stories - list scope screens without a story, create the accepted stories and close the stage through a merge request.
repos-sync
Use to update clones of your repositories under repos/ and see their branch, lag and uncommitted changes.
repos-add
Use to add a code repository to this workspace's manifest, table and your clones, through a merge request.