File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,8 +123,12 @@ const ALLOW = new Set([
123123 ...REACT_DOM_EXPORTS ,
124124] ) ;
125125
126- // A URL, an absolute path, a `<sha>:<path>`, or build output: none of these resolve in the tree.
126+ // Files a skill workflow writes into the user's project at run time; skill docs name them bare.
127+ const PROJECT_FILES = new Set ( [ "frame.md" , "STORYBOARD.md" , "SCRIPT.md" , "_role.md" ] ) ;
128+
129+ // A URL, an absolute path, a `<sha>:<path>`, build output or a project file: none resolve in the tree.
127130function namesSomethingElse ( cited ) {
131+ if ( PROJECT_FILES . has ( cited ) ) return true ;
128132 if ( cited . startsWith ( "/" ) || cited . startsWith ( "~" ) ) return true ;
129133 if ( cited . includes ( ":" ) ) return true ;
130134 return cited . split ( "/" ) [ 0 ] === "dist" ;
Original file line number Diff line number Diff line change @@ -67,6 +67,23 @@ test("a cited file that does not exist fails", (t) => {
6767 assert . equal ( failures [ 0 ] . where , "src/subject.ts:1" ) ;
6868} ) ;
6969
70+ test ( "a bare project file a skill workflow writes is not this repo's to resolve" , ( t ) => {
71+ const { failures } = checkSubject ( t , {
72+ "skills/demo/references/visual-design.md" : [ "Enrich `STORYBOARD.md` from `frame.md`." , "" ] . join (
73+ "\n" ,
74+ ) ,
75+ } ) ;
76+ assert . deepEqual ( failures , [ ] ) ;
77+ } ) ;
78+
79+ test ( "a repo path ending in a project file name is still resolved" , ( t ) => {
80+ const { failures } = checkSubject ( t , {
81+ "skills/demo/references/visual-design.md" : [ "See `skills/demo/frame.md`." , "" ] . join ( "\n" ) ,
82+ } ) ;
83+ assert . equal ( failures . length , 1 ) ;
84+ assert . match ( failures [ 0 ] . why , / n o s u c h f i l e / ) ;
85+ } ) ;
86+
7087test ( "a line number past the end of a real file fails" , ( t ) => {
7188 const { failures } = checkSubject ( t , {
7289 "src/subject.ts" : oneLiner ( "// Defined at `src/brand.ts:99`." ) ,
You can’t perform that action at this time.
0 commit comments