In "Castle" Season 6 Episode 18, "The Way of the Ninja," Beckett and Castle investigate the murder of a Japanese citizen, Jade Yamata. She is murdered at 3 in the morning.

Beckett is not thrilled about having dinner with her old high school friend, as she is competitive and keeps talking about her fabulous life, non-stop. Beckett's friend is married to a big-shot European businessman. However, Beckett does not want Castle to come along with her, fearing that her friend might try to seduce Castle as he is her kind of person. Beckett asks Castle to call her if he does not hear from her at 10 pm and to get her out of the situation.

At the murder site, Beckett and Castle discover that a knife was hurled into Jade's chest -- not stabbed into her chest -- killing her instantly. Ryan finds a drop key at the site. Jade was in the U.S for the last six months. She was a dancer and part of a ballet company. She was dating Dean Bedford, the son of the ballet company's owner, Randall Bedford. Dean, however, is not of much help and does not have a clue where his girl-friend had gone, all dressed-up.

Ryan finds out that the drop key was used to open an elevator at Marigold Cookie Company, which has been shut for years and the building has been abandoned. Jade's body was found two blocks away from the abandoned building. Castle and Beckett head to the building to investigate. Castle finds it unusual that there is no electricity, but there is an elevator.

The two open the elevator door with the drop-key and find a room. In the room, there is a shrine. Castle and Beckett find a knife kept at the shrine, which is similar to the murder weapon. When Beckett goes out of the room following a sound, a ninja kind of figure -- dressed in black with his face covered -- appears and takes the knife from Castle's hand and disappears in a puff of smoke.

Castle believes that ninja attacked him. Captain Gates and Beckett do not believe that he saw a ninja. A woman from Japanese consulate arrives. She informs Castle and Beckett that Jade's parents have been informed. The woman tells Castle there are no ninjas, anymore.

Esposito find out about bad blood between Jade and Lee Tong, a male dancer, as he had a thing for the murdered girl. He tells Castle and Beckett that Jade was planning to quit the ballet company. However, he does not know why she wanted to quit. Later, Ryan tells Castle and Beckett that calls were made every day to the same number at Miyago Tea Import Company.

Since Beckett has to go for dinner, Castle, Ryan and Esposito visit the tea import company. When the three step inside the company, they discover that the name is a front for a Japanese hostess bar. The three pretend that they have been to the place before. They talk about the girl that they had met during their last visit. One of the hostesses correctly guesses that they are talking about Jade. Later, in a private room, that girl informs Castle that ever since Jade joined the club, she used to flirt with a guy, Mr Saito, a regular client with a violent streak. Jade had wanted to get into the list of this man's private parties, and had finally succeeded. The girl thinks that Saito must have got her killed, as something had happened at the party. Jade was caught going through Saito's things and the man had been furious. However, Castle could not get more information, as he and his mates are kicked out of the club. Outside, they are attacked by a person dressed in a ninja costume, while another person, wearing a similar costume, saves Castle. The former warns the trio to stay away, or they will die.

Beckett is furious that Castle did not call her at 10 because he was making out with a Geisha. He realises that there is more to Beckett's issue of him not calling her. She tells him that her friend was boring and all the time complaining about her husband. There is no romance in her friend's life and it is endless routine of sameness. Her fabulous friend is not so fabulous anymore. Beckett is worried what if they become such kind of a married couple who are bored with each other. Castle says that let's put it in the vows, a promise that even if they are married, it does not mean that there is no romance in their lives. "We'll never ever be boring," Castle says to Beckett.

Ryan and Esposito find out that Micho Saito is a financier and his company is a front for organised crime. Beckett and Esposito visit his office. Saito says that he does not remember Jade and also no one was expelled from his party. When Beckett wants to see the guest list, Saito tells her to show the search warrant.

Ryan discovers that the woman who came from the Japanese consulate was an imposter. Later, Ryan tells Beckett that Jade did not have any parents. She was orphaned at the age of 10. Castle feels that someone is covering her birth history.

Esposito digs-out an old newspaper clipping of Okinawa Post, which reports about the murder of Ozu family. According to rumours, the family was killed by Green Dragon, a secret ninja enforcer of Yakuza, an organised crime syndicate. Esposito says that all of Okinawa was scared of Green Dragon, as he was a ruthless killer. Esposito believes that the little girl in the family photograph was Jade, and she had survived the fatal attack on her family. The new development makes Castle quip that it is revenge story. Jade was in the country to hunt down the Green Dragon. Beckett, Castle and Esposito come to the conclusion that Saito is the Green Dragon.

The imposter from the Japanese consulate is caught inside the cookie building. She reveals to Beckett and Castle that she is Jade's sister. She is a cop, as well. She tells Beckett and Castle that she and her sister hid when the Green Dragon came to their house. It is their uncle, a policeman, who found the two sisters and saved their life. Two days before her death, Jade had called her sister saying that she is closing-in on someone.

Jade's sister reveals that an American businessman had come to see her father, the day their family was killed. Green Dragon had sent him. Jade had heard his voice at the time, and had recognised his voice when a recent interview of his was aired on T.V. The American businessman turns out to be Randall Bedford. Also, Beckett and co find out that he was in business with the Green Dragon.

Randall says that he was not aware about Jade's real identity, as he thought the whole family was dead. In a property developing business, Randall was a builder, Mr Ozu was the architecture, while Saito provided the money. Randall had gone to meet Mr Ozu to warn him that the Green Dragon may kill him if he leaves the business. Mr Ozu had wanted to leave the business when he found out that Yakuza money is funding the business.

Beckett and Castle visit Saito, with the murder weapon found at his place. Castle says that they also have the testimony, which affirms that he is the Green Dragon who had killed Jade's family. Saito tells them that they have been played and he has been betrayed. He adds that he did not kill Jade and he is not the Green Dragon. Before he could reveal the name, a bullet hits him. A person, wearing the ninja costume, has shot him dead. This person then points the guns at Beckett and Castle. Before he could pull the trigger and kill Caskett, another person wearing the same ninja costume stops him. The good ninja versus the bad ninja fight takes place.

It turns out that Randall is the bad ninja and also the real Green Dragon, while the good ninja is Jade's sister. Beckett stops the sister from killing Randall.

Before leaving, Jade's sister tells Castle once again that there are no ninjas.